home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1997-10-07 | 16.5 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
1%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Oct 7 02:59:54 1997, modified Tue Oct 7 02:59:54 1997, creator 'MPS ', type ASCII, 16158 bytes "StdCTB.c" , at 0x3f9e 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| dearkID
| deark: macbinary
| default
| |
100%
| lsar
| MacBinary
| default
| |
100%
| librempegprobeID
| NGC (Nintendo DSP Standard) (ngcdspstd)
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 53 74 64 43 54 42 | 2e 63 00 00 00 00 00 00 |..StdCTB|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 3f 1e 00 | 00 01 ac b0 5f 8e 6a b0 |.....?..|...._.j.|
|00000060| 5f 8e 6a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |_.j.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 7a 78 00 00 |........|....zx..|
|00000080| 2f 2a 09 53 69 6d 70 6c | 65 20 69 6e 74 65 72 66 |/*.Simpl|e interf|
|00000090| 61 63 65 73 20 74 6f 20 | 74 68 65 20 63 6f 6d 6d |aces to |the comm|
|000000a0| 75 6e 69 63 61 74 69 6f | 6e 73 20 74 6f 6f 6c 62 |unicatio|ns toolb|
|000000b0| 6f 78 2e 20 20 64 6f 65 | 73 6e 27 74 20 77 6f 72 |ox. doe|sn't wor|
|000000c0| 6b 20 77 69 74 68 0d 09 | 73 63 74 62 2c 20 74 68 |k with..|sctb, th|
|000000d0| 65 79 27 72 65 20 64 69 | 66 66 65 72 65 6e 74 2e |ey're di|fferent.|
|000000e0| 0d 09 43 6f 70 79 72 69 | 67 68 74 20 28 63 29 20 |..Copyri|ght (c) |
|000000f0| 31 39 39 37 20 62 79 20 | 4a 6f 68 6e 20 4d 6f 6e |1997 by |John Mon|
|00000100| 74 62 72 69 61 6e 64 2e | 20 20 41 6c 6c 20 52 69 |tbriand.| All Ri|
|00000110| 67 68 74 73 20 52 65 73 | 65 72 76 65 64 2e 0d 09 |ghts Res|erved...|
|00000120| 50 65 72 6d 69 73 73 69 | 6f 6e 20 67 72 61 6e 74 |Permissi|on grant|
|00000130| 65 64 20 66 6f 72 20 70 | 75 62 6c 69 63 20 75 73 |ed for p|ublic us|
|00000140| 65 2e 0d 09 44 69 73 74 | 72 69 62 75 74 65 20 66 |e...Dist|ribute f|
|00000150| 72 65 65 6c 79 20 69 6e | 20 61 72 65 61 73 20 77 |reely in| areas w|
|00000160| 68 65 72 65 20 74 68 65 | 20 6c 61 77 73 20 6f 66 |here the| laws of|
|00000170| 20 63 6f 70 79 72 69 67 | 68 74 20 61 70 70 6c 79 | copyrig|ht apply|
|00000180| 2e 0d 09 55 53 45 20 41 | 54 20 59 4f 55 52 20 4f |...USE A|T YOUR O|
|00000190| 57 4e 20 52 49 53 4b 2e | 0d 09 44 4f 20 4e 4f 54 |WN RISK.|..DO NOT|
|000001a0| 20 44 49 53 54 52 49 42 | 55 54 45 20 4d 4f 44 49 | DISTRIB|UTE MODI|
|000001b0| 46 49 45 44 20 43 4f 50 | 49 45 53 2e 0d 09 43 6f |FIED COP|IES...Co|
|000001c0| 6d 6d 65 6e 74 73 2f 71 | 75 65 73 74 69 6f 6e 73 |mments/q|uestions|
|000001d0| 2f 70 6f 73 74 63 61 72 | 64 73 20 74 6f 20 74 68 |/postcar|ds to th|
|000001e0| 65 20 61 75 74 68 6f 72 | 20 61 74 20 74 68 65 20 |e author| at the |
|000001f0| 61 64 64 72 65 73 73 3a | 0d 09 09 4a 6f 68 6e 20 |address:|...John |
|00000200| 4d 6f 6e 74 62 72 69 61 | 6e 64 0d 09 09 50 2e 4f |Montbria|nd...P.O|
|00000210| 2e 20 42 6f 78 2e 20 31 | 31 33 33 0d 09 09 53 61 |. Box. 1|133...Sa|
|00000220| 73 6b 61 74 6f 6f 6e 20 | 53 61 73 6b 61 74 63 68 |skatoon |Saskatch|
|00000230| 65 77 61 6e 20 43 61 6e | 61 64 61 0d 09 09 53 37 |ewan Can|ada...S7|
|00000240| 4b 20 33 4e 32 0d 09 6f | 72 20 62 79 20 65 6d 61 |K 3N2..o|r by ema|
|00000250| 69 6c 20 61 74 3a 0d 09 | 09 74 69 6e 79 6a 6f 68 |il at:..|.tinyjoh|
|00000260| 6e 40 73 6b 2e 73 79 6d | 70 61 74 69 63 6f 2e 63 |n@sk.sym|patico.c|
|00000270| 61 0d 09 49 66 20 79 6f | 75 20 77 6f 75 6c 64 20 |a..If yo|u would |
|00000280| 6c 69 6b 65 20 74 6f 20 | 68 61 76 65 3a 0d 09 09 |like to |have:...|
|00000290| 74 65 63 68 6e 69 63 61 | 6c 20 73 75 70 70 6f 72 |technica|l suppor|
|000002a0| 74 20 72 65 67 61 72 64 | 69 6e 67 20 74 68 69 73 |t regard|ing this|
|000002b0| 20 66 69 6c 65 2c 20 73 | 65 6e 64 20 61 20 70 6f | file, s|end a po|
|000002c0| 73 74 63 61 72 64 2e 0d | 09 73 65 65 20 61 6c 73 |stcard..|.see als|
|000002d0| 6f 3a 0d 09 09 68 74 74 | 70 3a 2f 2f 77 77 77 33 |o:...htt|p://www3|
|000002e0| 2e 73 6b 2e 73 79 6d 70 | 61 74 69 63 6f 2e 63 61 |.sk.symp|atico.ca|
|000002f0| 2f 74 69 6e 79 6a 6f 68 | 6e 0d 2a 2f 0d 0d 23 69 |/tinyjoh|n.*/..#i|
|00000300| 6e 63 6c 75 64 65 20 22 | 53 74 64 43 54 42 2e 68 |nclude "|StdCTB.h|
|00000310| 22 0d 23 69 6e 63 6c 75 | 64 65 20 3c 4d 65 6d 6f |".#inclu|de <Memo|
|00000320| 72 79 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |ry.h>.#i|nclude <|
|00000330| 4f 53 55 74 69 6c 73 2e | 68 3e 0d 23 69 6e 63 6c |OSUtils.|h>.#incl|
|00000340| 75 64 65 20 3c 43 6f 6d | 6d 52 65 73 6f 75 72 63 |ude <Com|mResourc|
|00000350| 65 73 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |es.h>.#i|nclude <|
|00000360| 53 74 64 41 72 67 2e 68 | 3e 0d 23 69 6e 63 6c 75 |StdArg.h|>.#inclu|
|00000370| 64 65 20 3c 45 72 72 6f | 72 73 2e 68 3e 0d 23 69 |de <Erro|rs.h>.#i|
|00000380| 6e 63 6c 75 64 65 20 3c | 52 65 73 6f 75 72 63 65 |nclude <|Resource|
|00000390| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 50 |s.h>.#in|clude <P|
|000003a0| 4c 53 74 72 69 6e 67 46 | 75 6e 63 73 2e 68 3e 0d |LStringF|uncs.h>.|
|000003b0| 23 69 6e 63 6c 75 64 65 | 20 3c 54 65 78 74 55 74 |#include| <TextUt|
|000003c0| 69 6c 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |ils.h>.#|include |
|000003d0| 3c 73 74 72 69 6e 67 2e | 68 3e 0d 0d 0d 4f 53 45 |<string.|h>...OSE|
|000003e0| 72 72 20 49 6e 69 74 43 | 54 42 4c 69 62 28 76 6f |rr InitC|TBLib(vo|
|000003f0| 69 64 29 20 7b 0d 09 4f | 53 45 72 72 20 65 72 72 |id) {..O|SErr err|
|00000400| 3b 0d 09 69 66 20 28 28 | 65 72 72 20 3d 20 49 6e |;..if ((|err = In|
|00000410| 69 74 43 54 42 55 74 69 | 6c 69 74 69 65 73 28 29 |itCTBUti|lities()|
|00000420| 29 20 21 3d 20 6e 6f 45 | 72 72 29 20 72 65 74 75 |) != noE|rr) retu|
|00000430| 72 6e 20 65 72 72 3b 0d | 09 69 66 20 28 28 65 72 |rn err;.|.if ((er|
|00000440| 72 20 3d 20 49 6e 69 74 | 43 52 4d 28 29 29 20 21 |r = Init|CRM()) !|
|00000450| 3d 20 6e 6f 45 72 72 29 | 20 72 65 74 75 72 6e 20 |= noErr)| return |
|00000460| 65 72 72 3b 0d 09 69 66 | 20 28 28 65 72 72 20 3d |err;..if| ((err =|
|00000470| 20 49 6e 69 74 43 4d 28 | 29 29 20 21 3d 20 6e 6f | InitCM(|)) != no|
|00000480| 45 72 72 29 20 72 65 74 | 75 72 6e 20 65 72 72 3b |Err) ret|urn err;|
|00000490| 0d 09 69 66 20 28 28 65 | 72 72 20 3d 20 49 6e 69 |..if ((e|rr = Ini|
|000004a0| 74 46 54 28 29 29 20 21 | 3d 20 6e 6f 45 72 72 29 |tFT()) !|= noErr)|
|000004b0| 20 72 65 74 75 72 6e 20 | 65 72 72 3b 0d 09 72 65 | return |err;..re|
|000004c0| 74 75 72 6e 20 6e 6f 45 | 72 72 3b 0d 7d 0d 65 78 |turn noE|rr;.}.ex|
|000004d0| 74 65 72 6e 20 70 61 73 | 63 61 6c 20 76 6f 69 64 |tern pas|cal void|
|000004e0| 20 43 4d 53 65 74 52 65 | 66 43 6f 6e 28 43 6f 6e | CMSetRe|fCon(Con|
|000004f0| 6e 48 61 6e 64 6c 65 20 | 68 43 6f 6e 6e 2c 20 6c |nHandle |hConn, l|
|00000500| 6f 6e 67 20 72 65 66 43 | 6f 6e 29 3b 0d 65 78 74 |ong refC|on);.ext|
|00000510| 65 72 6e 20 70 61 73 63 | 61 6c 20 6c 6f 6e 67 20 |ern pasc|al long |
|00000520| 43 4d 47 65 74 52 65 66 | 43 6f 6e 28 43 6f 6e 6e |CMGetRef|Con(Conn|
|00000530| 48 61 6e 64 6c 65 20 68 | 43 6f 6e 6e 29 3b 0d 65 |Handle h|Conn);.e|
|00000540| 78 74 65 72 6e 20 70 61 | 73 63 61 6c 20 6c 6f 6e |xtern pa|scal lon|
|00000550| 67 20 43 4d 47 65 74 55 | 73 65 72 44 61 74 61 28 |g CMGetU|serData(|
|00000560| 43 6f 6e 6e 48 61 6e 64 | 6c 65 20 68 43 6f 6e 6e |ConnHand|le hConn|
|00000570| 29 3b 0d 65 78 74 65 72 | 6e 20 70 61 73 63 61 6c |);.exter|n pascal|
|00000580| 20 76 6f 69 64 20 43 4d | 53 65 74 55 73 65 72 44 | void CM|SetUserD|
|00000590| 61 74 61 28 43 6f 6e 6e | 48 61 6e 64 6c 65 20 68 |ata(Conn|Handle h|
|000005a0| 43 6f 6e 6e 2c 20 6c 6f | 6e 67 20 75 73 65 72 44 |Conn, lo|ng userD|
|000005b0| 61 74 61 29 3b 0d 0d 4f | 53 45 72 72 20 47 65 74 |ata);..O|SErr Get|
|000005c0| 43 6f 6e 6e 65 63 74 69 | 6f 6e 43 6f 6e 66 69 67 |Connecti|onConfig|
|000005d0| 75 72 61 74 69 6f 6e 28 | 43 6f 6e 6e 48 61 6e 64 |uration(|ConnHand|
|000005e0| 6c 65 20 63 6f 6e 6e 2c | 20 42 6f 6f 6c 65 61 6e |le conn,| Boolean|
|000005f0| 20 2a 63 68 61 6e 67 65 | 64 2c 20 48 61 6e 64 6c | *change|d, Handl|
|00000600| 65 20 63 68 29 20 7b 0d | 09 53 74 72 32 35 35 20 |e ch) {.|.Str255 |
|00000610| 74 6f 6f 6c 5f 6e 61 6d | 65 3b 0d 09 63 68 61 72 |tool_nam|e;..char|
|00000620| 2a 20 63 6f 6e 66 69 67 | 5f 74 65 78 74 3b 0d 09 |* config|_text;..|
|00000630| 48 61 6e 64 6c 65 20 6e | 65 77 63 6f 6e 66 69 67 |Handle n|ewconfig|
|00000640| 3b 0d 09 4f 53 45 72 72 | 20 65 72 72 3b 0d 09 42 |;..OSErr| err;..B|
|00000650| 6f 6f 6c 65 61 6e 20 73 | 74 61 74 65 6c 6f 63 6b |oolean s|tatelock|
|00000660| 3b 0d 09 63 68 61 72 20 | 73 74 61 74 65 3b 0d 09 |;..char |state;..|
|00000670| 0d 09 09 2f 2a 20 73 65 | 74 20 75 70 20 61 20 73 |.../* se|t up a s|
|00000680| 61 66 65 20 73 74 61 74 | 65 20 2a 2f 0d 09 63 6f |afe stat|e */..co|
|00000690| 6e 66 69 67 5f 74 65 78 | 74 20 3d 20 4e 55 4c 4c |nfig_tex|t = NULL|
|000006a0| 3b 0d 09 6e 65 77 63 6f | 6e 66 69 67 20 3d 20 4e |;..newco|nfig = N|
|000006b0| 55 4c 4c 3b 0d 09 73 74 | 61 74 65 6c 6f 63 6b 20 |ULL;..st|atelock |
|000006c0| 3d 20 66 61 6c 73 65 3b | 0d 09 0d 09 09 2f 2a 20 |= false;|...../* |
|000006d0| 67 65 74 20 74 68 65 20 | 74 6f 6f 6c 20 6e 61 6d |get the |tool nam|
|000006e0| 65 20 61 6e 64 20 63 6f | 6e 66 69 67 75 72 61 74 |e and co|nfigurat|
|000006f0| 69 6f 6e 20 2a 2f 0d 09 | 43 4d 47 65 74 54 6f 6f |ion */..|CMGetToo|
|00000700| 6c 4e 61 6d 65 28 28 2a | 63 6f 6e 6e 29 2d 3e 70 |lName((*|conn)->p|
|00000710| 72 6f 63 49 44 2c 20 74 | 6f 6f 6c 5f 6e 61 6d 65 |rocID, t|ool_name|
|00000720| 29 3b 0d 09 63 6f 6e 66 | 69 67 5f 74 65 78 74 20 |);..conf|ig_text |
|00000730| 3d 20 28 63 68 61 72 2a | 29 20 43 4d 47 65 74 43 |= (char*|) CMGetC|
|00000740| 6f 6e 66 69 67 28 63 6f | 6e 6e 29 3b 0d 09 69 66 |onfig(co|nn);..if|
|00000750| 20 28 63 6f 6e 66 69 67 | 5f 74 65 78 74 20 3d 3d | (config|_text ==|
|00000760| 20 4e 55 4c 4c 29 20 7b | 20 65 72 72 20 3d 20 6d | NULL) {| err = m|
|00000770| 65 6d 46 75 6c 6c 45 72 | 72 3b 20 67 6f 74 6f 20 |emFullEr|r; goto |
|00000780| 62 61 69 6c 3b 20 7d 0d | 09 09 0d 09 69 66 20 28 |bail; }.|....if (|
|00000790| 28 65 72 72 20 3d 20 50 | 74 72 54 6f 48 61 6e 64 |(err = P|trToHand|
|000007a0| 28 74 6f 6f 6c 5f 6e 61 | 6d 65 2c 20 26 6e 65 77 |(tool_na|me, &new|
|000007b0| 63 6f 6e 66 69 67 2c 20 | 74 6f 6f 6c 5f 6e 61 6d |config, |tool_nam|
|000007c0| 65 5b 30 5d 2b 31 29 29 | 20 21 3d 20 6e 6f 45 72 |e[0]+1))| != noEr|
|000007d0| 72 29 20 67 6f 74 6f 20 | 62 61 69 6c 3b 0d 09 69 |r) goto |bail;..i|
|000007e0| 66 20 28 28 65 72 72 20 | 3d 20 50 74 72 41 6e 64 |f ((err |= PtrAnd|
|000007f0| 48 61 6e 64 28 63 6f 6e | 66 69 67 5f 74 65 78 74 |Hand(con|fig_text|
|00000800| 2c 20 6e 65 77 63 6f 6e | 66 69 67 2c 20 73 74 72 |, newcon|fig, str|
|00000810| 6c 65 6e 28 63 6f 6e 66 | 69 67 5f 74 65 78 74 29 |len(conf|ig_text)|
|00000820| 2b 31 29 29 20 21 3d 20 | 6e 6f 45 72 72 29 20 67 |+1)) != |noErr) g|
|00000830| 6f 74 6f 20 62 61 69 6c | 3b 0d 0d 09 48 4c 6f 63 |oto bail|;...HLoc|
|00000840| 6b 28 6e 65 77 63 6f 6e | 66 69 67 29 3b 0d 09 73 |k(newcon|fig);..s|
|00000850| 74 61 74 65 20 3d 20 48 | 47 65 74 53 74 61 74 65 |tate = H|GetState|
|00000860| 28 63 68 29 3b 0d 09 73 | 74 61 74 65 6c 6f 63 6b |(ch);..s|tatelock|
|00000870| 20 3d 20 74 72 75 65 3b | 0d 09 48 4c 6f 63 6b 28 | = true;|..HLock(|
|00000880| 63 68 29 3b 0d 09 69 66 | 20 28 47 65 74 48 61 6e |ch);..if| (GetHan|
|00000890| 64 6c 65 53 69 7a 65 28 | 63 68 29 20 21 3d 20 47 |dleSize(|ch) != G|
|000008a0| 65 74 48 61 6e 64 6c 65 | 53 69 7a 65 28 6e 65 77 |etHandle|Size(new|
|000008b0| 63 6f 6e 66 69 67 29 0d | 09 7c 7c 20 6d 65 6d 63 |config).|.|| memc|
|000008c0| 6d 70 28 2a 6e 65 77 63 | 6f 6e 66 69 67 2c 20 2a |mp(*newc|onfig, *|
|000008d0| 63 68 2c 20 47 65 74 48 | 61 6e 64 6c 65 53 69 7a |ch, GetH|andleSiz|
|000008e0| 65 28 6e 65 77 63 6f 6e | 66 69 67 29 29 20 21 3d |e(newcon|fig)) !=|
|000008f0| 20 30 29 20 7b 0d 09 09 | 48 55 6e 6c 6f 63 6b 28 | 0) {...|HUnlock(|
|00000900| 63 68 29 3b 0d 09 09 69 | 66 20 28 28 65 72 72 20 |ch);...i|f ((err |
|00000910| 3d 20 50 74 72 54 6f 58 | 48 61 6e 64 28 2a 6e 65 |= PtrToX|Hand(*ne|
|00000920| 77 63 6f 6e 66 69 67 2c | 20 63 68 2c 20 47 65 74 |wconfig,| ch, Get|
|00000930| 48 61 6e 64 6c 65 53 69 | 7a 65 28 6e 65 77 63 6f |HandleSi|ze(newco|
|00000940| 6e 66 69 67 29 29 29 20 | 21 3d 20 6e 6f 45 72 72 |nfig))) |!= noErr|
|00000950| 29 20 67 6f 74 6f 20 62 | 61 69 6c 3b 0d 09 09 2a |) goto b|ail;...*|
|00000960| 63 68 61 6e 67 65 64 20 | 3d 20 74 72 75 65 3b 0d |changed |= true;.|
|00000970| 09 7d 20 65 6c 73 65 20 | 2a 63 68 61 6e 67 65 64 |.} else |*changed|
|00000980| 20 3d 20 66 61 6c 73 65 | 3b 0d 09 48 53 65 74 53 | = false|;..HSetS|
|00000990| 74 61 74 65 28 63 68 2c | 20 73 74 61 74 65 29 3b |tate(ch,| state);|
|000009a0| 0d 09 09 2f 2a 20 63 6c | 65 61 6e 20 75 70 20 61 |.../* cl|ean up a|
|000009b0| 6e 64 20 67 6f 20 61 77 | 61 79 20 2a 2f 0d 09 44 |nd go aw|ay */..D|
|000009c0| 69 73 70 6f 73 65 48 61 | 6e 64 6c 65 28 6e 65 77 |isposeHa|ndle(new|
|000009d0| 63 6f 6e 66 69 67 29 3b | 0d 09 44 69 73 70 6f 73 |config);|..Dispos|
|000009e0| 65 50 74 72 28 63 6f 6e | 66 69 67 5f 74 65 78 74 |ePtr(con|fig_text|
|000009f0| 29 3b 0d 09 72 65 74 75 | 72 6e 20 6e 6f 45 72 72 |);..retu|rn noErr|
|00000a00| 3b 0d 0d 62 61 69 6c 3a | 0d 09 69 66 20 28 73 74 |;..bail:|..if (st|
|00000a10| 61 74 65 6c 6f 63 6b 29 | 20 48 53 65 74 53 74 61 |atelock)| HSetSta|
|00000a20| 74 65 28 63 68 2c 20 73 | 74 61 74 65 29 3b 0d 09 |te(ch, s|tate);..|
|00000a30| 69 66 20 28 6e 65 77 63 | 6f 6e 66 69 67 20 21 3d |if (newc|onfig !=|
|00000a40| 20 4e 55 4c 4c 29 20 44 | 69 73 70 6f 73 65 48 61 | NULL) D|isposeHa|
|00000a50| 6e 64 6c 65 28 6e 65 77 | 63 6f 6e 66 69 67 29 3b |ndle(new|config);|
|00000a60| 0d 09 69 66 20 28 63 6f | 6e 66 69 67 5f 74 65 78 |..if (co|nfig_tex|
|00000a70| 74 20 21 3d 20 4e 55 4c | 4c 29 20 44 69 73 70 6f |t != NUL|L) Dispo|
|00000a80| 73 65 50 74 72 28 63 6f | 6e 66 69 67 5f 74 65 78 |sePtr(co|nfig_tex|
|00000a90| 74 29 3b 0d 09 72 65 74 | 75 72 6e 20 65 72 72 3b |t);..ret|urn err;|
|00000aa0| 0d 7d 0d 0d 0d 4f 53 45 | 72 72 20 4d 61 6b 65 43 |.}...OSE|rr MakeC|
|00000ab0| 6f 6e 66 69 67 75 72 65 | 64 43 6f 6e 6e 65 63 74 |onfigure|dConnect|
|00000ac0| 69 6f 6e 28 48 61 6e 64 | 6c 65 20 63 68 2c 20 43 |ion(Hand|le ch, C|
|00000ad0| 6f 6e 6e 48 61 6e 64 6c | 65 20 2a 63 6f 6e 6e 29 |onnHandl|e *conn)|
|00000ae0| 20 7b 0d 09 75 6e 73 69 | 67 6e 65 64 20 63 68 61 | {..unsi|gned cha|
|00000af0| 72 20 2a 63 68 70 3b 0d | 09 4f 53 45 72 72 20 65 |r *chp;.|.OSErr e|
|00000b00| 72 72 3b 0d 09 73 68 6f | 72 74 20 70 72 6f 63 5f |rr;..sho|rt proc_|
|00000b10| 69 64 3b 0d 09 63 68 61 | 72 20 63 68 5f 73 74 61 |id;..cha|r ch_sta|
|00000b20| 74 65 3b 0d 09 43 4d 42 | 75 66 66 65 72 53 69 7a |te;..CMB|ufferSiz|
|00000b30| 65 73 20 62 75 66 66 65 | 72 73 69 7a 65 73 20 3d |es buffe|rsizes =|
|00000b40| 20 7b 20 30 2c 20 30 2c | 20 30 2c 20 30 2c 20 30 | { 0, 0,| 0, 0, 0|
|00000b50| 2c 20 30 2c 20 30 2c 20 | 30 7d 3b 0d 09 09 0d 09 |, 0, 0, |0};.....|
|00000b60| 09 2f 2a 20 63 68 65 63 | 6b 20 70 61 72 61 6d 65 |./* chec|k parame|
|00000b70| 74 65 72 73 20 61 6e 64 | 20 69 6e 69 74 69 61 6c |ters and| initial|
|00000b80| 69 7a 65 20 2a 2f 0d 09 | 69 66 20 28 63 68 20 3d |ize */..|if (ch =|
|00000b90| 3d 20 4e 55 4c 4c 29 20 | 72 65 74 75 72 6e 20 70 |= NULL) |return p|
|00000ba0| 61 72 61 6d 45 72 72 3b | 0d 09 63 68 5f 73 74 61 |aramErr;|..ch_sta|
|00000bb0| 74 65 20 3d 20 48 47 65 | 74 53 74 61 74 65 28 63 |te = HGe|tState(c|
|00000bc0| 68 29 3b 0d 09 48 4c 6f | 63 6b 28 63 68 29 3b 0d |h);..HLo|ck(ch);.|
|00000bd0| 09 0d 09 09 2f 2a 20 67 | 65 74 20 74 68 65 20 74 |..../* g|et the t|
|00000be0| 6f 6f 6c 27 73 20 70 72 | 6f 63 49 44 20 6e 75 6d |ool's pr|ocID num|
|00000bf0| 62 65 72 20 75 73 69 6e | 67 20 74 68 65 20 6e 61 |ber usin|g the na|
|00000c00| 6d 65 20 2a 2f 0d 09 63 | 68 70 20 3d 20 28 75 6e |me */..c|hp = (un|
|00000c10| 73 69 67 6e 65 64 20 63 | 68 61 72 2a 29 20 28 2a |signed c|har*) (*|
|00000c20| 63 68 29 3b 0d 09 69 66 | 20 28 28 70 72 6f 63 5f |ch);..if| ((proc_|
|00000c30| 69 64 20 3d 20 43 4d 47 | 65 74 50 72 6f 63 49 44 |id = CMG|etProcID|
|00000c40| 28 63 68 70 29 29 20 3d | 3d 20 2d 31 29 20 7b 20 |(chp)) =|= -1) { |
|00000c50| 65 72 72 20 3d 20 70 61 | 72 61 6d 45 72 72 3b 20 |err = pa|ramErr; |
|00000c60| 67 6f 74 6f 20 62 61 69 | 6c 3b 20 7d 0d 09 63 68 |goto bai|l; }..ch|
|00000c70| 70 20 2b 3d 20 2a 63 68 | 70 20 2b 20 31 3b 0d 09 |p += *ch|p + 1;..|
|00000c80| 0d 09 09 2f 2a 20 63 72 | 65 61 74 65 20 74 68 65 |.../* cr|eate the|
|00000c90| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 20 72 65 63 6f | connect|ion reco|
|00000ca0| 72 64 20 2a 2f 0d 09 2a | 63 6f 6e 6e 20 3d 20 43 |rd */..*|conn = C|
|00000cb0| 4d 4e 65 77 28 70 72 6f | 63 5f 69 64 2c 20 63 6d |MNew(pro|c_id, cm|
|00000cc0| 44 61 74 61 2c 20 62 75 | 66 66 65 72 73 69 7a 65 |Data, bu|ffersize|
|00000cd0| 73 2c 20 30 2c 20 30 29 | 3b 0d 09 69 66 20 28 2a |s, 0, 0)|;..if (*|
|00000ce0| 63 6f 6e 6e 20 3d 3d 20 | 4e 55 4c 4c 29 20 7b 20 |conn == |NULL) { |
|00000cf0| 65 72 72 20 3d 20 6d 65 | 6d 46 75 6c 6c 45 72 72 |err = me|mFullErr|
|00000d00| 3b 20 67 6f 74 6f 20 62 | 61 69 6c 3b 20 7d 0d 09 |; goto b|ail; }..|
|00000d10| 0d 09 09 2f 2a 20 73 65 | 74 20 74 68 65 20 74 6f |.../* se|t the to|
|00000d20| 6f 6c 27 73 20 63 6f 6e | 66 69 67 75 72 61 74 69 |ol's con|figurati|
|00000d30| 6f 6e 20 75 73 69 6e 67 | 20 74 68 65 20 63 6f 6e |on using| the con|
|00000d40| 66 69 67 75 72 61 74 69 | 6f 6e 20 73 74 72 69 6e |figurati|on strin|
|00000d50| 67 20 2a 2f 0d 09 65 72 | 72 20 3d 20 43 4d 53 65 |g */..er|r = CMSe|
|00000d60| 74 43 6f 6e 66 69 67 28 | 2a 63 6f 6e 6e 2c 20 63 |tConfig(|*conn, c|
|00000d70| 68 70 29 3b 0d 09 69 66 | 20 28 65 72 72 20 3c 20 |hp);..if| (err < |
|00000d80| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 62 61 69 6c |noErr) g|oto bail|
|00000d90| 3b 0d 09 0d 09 09 2f 2a | 20 63 6c 65 61 6e 20 75 |;...../*| clean u|
|00000da0| 70 20 61 6e 64 20 67 6f | 20 2a 2f 0d 09 48 53 65 |p and go| */..HSe|
|00000db0| 74 53 74 61 74 65 28 63 | 68 2c 20 63 68 5f 73 74 |tState(c|h, ch_st|
|00000dc0| 61 74 65 29 3b 0d 09 72 | 65 74 75 72 6e 20 6e 6f |ate);..r|eturn no|
|00000dd0| 45 72 72 3b 0d 0d 62 61 | 69 6c 3a 0d 09 48 53 65 |Err;..ba|il:..HSe|
|00000de0| 74 53 74 61 74 65 28 63 | 68 2c 20 63 68 5f 73 74 |tState(c|h, ch_st|
|00000df0| 61 74 65 29 3b 0d 09 72 | 65 74 75 72 6e 20 65 72 |ate);..r|eturn er|
|00000e00| 72 3b 0d 7d 0d 0d 4f 53 | 45 72 72 20 4d 61 6b 65 |r;.}..OS|Err Make|
|00000e10| 4e 65 77 43 6f 6e 6e 65 | 63 74 69 6f 6e 28 43 6f |NewConne|ction(Co|
|00000e20| 6e 6e 48 61 6e 64 6c 65 | 20 2a 63 6f 6e 6e 29 20 |nnHandle| *conn) |
|00000e30| 7b 0d 09 53 74 72 32 35 | 35 20 74 6f 6f 6c 5f 6e |{..Str25|5 tool_n|
|00000e40| 61 6d 65 3b 0d 09 73 68 | 6f 72 74 20 70 72 6f 63 |ame;..sh|ort proc|
|00000e50| 5f 69 64 3b 0d 09 4f 53 | 45 72 72 20 65 72 72 2c |_id;..OS|Err err,|
|00000e60| 20 63 6f 6e 6e 5f 65 72 | 72 3b 0d 09 50 6f 69 6e | conn_er|r;..Poin|
|00000e70| 74 20 70 74 3b 0d 09 43 | 4d 42 75 66 66 65 72 53 |t pt;..C|MBufferS|
|00000e80| 69 7a 65 73 20 62 75 66 | 66 65 72 73 69 7a 65 73 |izes buf|fersizes|
|00000e90| 20 3d 20 7b 30 2c 30 2c | 30 2c 30 2c 30 2c 30 2c | = {0,0,|0,0,0,0,|
|00000ea0| 30 2c 30 7d 3b 0d 09 0d | 09 09 2f 2a 20 73 65 74 |0,0};...|../* set|
|00000eb0| 20 75 70 20 61 20 73 61 | 66 65 20 73 74 61 74 65 | up a sa|fe state|
|00000ec0| 20 2a 2f 0d 09 2a 63 6f | 6e 6e 20 3d 20 4e 55 4c | */..*co|nn = NUL|
|00000ed0| 4c 3b 0d 09 0d 09 09 2f | 2a 20 67 65 74 20 74 68 |L;...../|* get th|
|00000ee0| 65 20 66 69 72 73 74 20 | 74 6f 6f 6c 20 69 64 20 |e first |tool id |
|00000ef0| 2a 2f 0d 09 65 72 72 20 | 3d 20 43 52 4d 47 65 74 |*/..err |= CRMGet|
|00000f00| 49 6e 64 54 6f 6f 6c 4e | 61 6d 65 28 63 6c 61 73 |IndToolN|ame(clas|
|00000f10| 73 43 4d 2c 20 31 2c 20 | 74 6f 6f 6c 5f 6e 61 6d |sCM, 1, |tool_nam|
|00000f20| 65 29 3b 0d 09 69 66 20 | 28 65 72 72 20 21 3d 20 |e);..if |(err != |
|00000f30| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 62 61 69 6c |noErr) g|oto bail|
|00000f40| 3b 0d 09 69 66 20 28 28 | 70 72 6f 63 5f 69 64 20 |;..if ((|proc_id |
|00000f50| 3d 20 43 4d 47 65 74 50 | 72 6f 63 49 44 28 74 6f |= CMGetP|rocID(to|
|00000f60| 6f 6c 5f 6e 61 6d 65 29 | 29 20 3d 3d 20 2d 31 29 |ol_name)|) == -1)|
|00000f70| 20 7b 20 65 72 72 20 3d | 20 70 61 72 61 6d 45 72 | { err =| paramEr|
|00000f80| 72 3b 20 67 6f 74 6f 20 | 62 61 69 6c 3b 20 7d 0d |r; goto |bail; }.|
|00000f90| 09 0d 09 09 2f 2a 20 63 | 72 65 61 74 65 20 61 20 |..../* c|reate a |
|00000fa0| 6e 65 77 20 63 6f 6e 6e | 65 63 74 69 6f 6e 20 72 |new conn|ection r|
|00000fb0| 65 63 6f 72 64 20 2a 2f | 0d 09 2a 63 6f 6e 6e 20 |ecord */|..*conn |
|00000fc0| 3d 20 43 4d 4e 65 77 28 | 70 72 6f 63 5f 69 64 2c |= CMNew(|proc_id,|
|00000fd0| 20 63 6d 44 61 74 61 2c | 20 62 75 66 66 65 72 73 | cmData,| buffers|
|00000fe0| 69 7a 65 73 2c 20 30 2c | 20 30 29 3b 0d 09 69 66 |izes, 0,| 0);..if|
|00000ff0| 20 28 2a 63 6f 6e 6e 20 | 3d 3d 20 4e 55 4c 4c 29 | (*conn |== NULL)|
|00001000| 20 7b 20 65 72 72 20 3d | 20 6d 65 6d 46 75 6c 6c | { err =| memFull|
|00001010| 45 72 72 3b 20 67 6f 74 | 6f 20 62 61 69 6c 3b 20 |Err; got|o bail; |
|00001020| 7d 0d 09 0d 09 09 2f 2a | 20 63 61 6c 6c 20 43 4d |}...../*| call CM|
|00001030| 43 68 6f 6f 73 65 20 74 | 6f 20 63 6f 6e 66 69 67 |Choose t|o config|
|00001040| 75 72 65 20 74 68 65 20 | 63 6f 6e 6e 65 63 74 69 |ure the |connecti|
|00001050| 6f 6e 20 2a 2f 0d 09 70 | 74 2e 68 20 3d 20 31 30 |on */..p|t.h = 10|
|00001060| 3b 20 70 74 2e 76 20 3d | 20 31 30 20 2b 20 47 65 |; pt.v =| 10 + Ge|
|00001070| 74 4d 42 61 72 48 65 69 | 67 68 74 28 29 3b 0d 09 |tMBarHei|ght();..|
|00001080| 69 66 20 28 28 65 72 72 | 20 3d 20 43 4d 43 68 6f |if ((err| = CMCho|
|00001090| 6f 73 65 28 63 6f 6e 6e | 2c 20 70 74 2c 20 4e 55 |ose(conn|, pt, NU|
|000010a0| 4c 4c 29 29 20 3c 20 30 | 29 20 67 6f 74 6f 20 62 |LL)) < 0|) goto b|
|000010b0| 61 69 6c 3b 0d 09 72 65 | 74 75 72 6e 20 6e 6f 45 |ail;..re|turn noE|
|000010c0| 72 72 3b 0d 0d 62 61 69 | 6c 3a 0d 09 69 66 20 28 |rr;..bai|l:..if (|
|000010d0| 2a 63 6f 6e 6e 20 21 3d | 20 4e 55 4c 4c 29 20 43 |*conn !=| NULL) C|
|000010e0| 4d 44 69 73 70 6f 73 65 | 28 2a 63 6f 6e 6e 29 3b |MDispose|(*conn);|
|000010f0| 0d 09 72 65 74 75 72 6e | 20 65 72 72 3b 0d 7d 0d |..return| err;.}.|
|00001100| 0d 4f 53 45 72 72 20 43 | 6f 6e 6e 53 65 6e 64 28 |.OSErr C|onnSend(|
|00001110| 43 6f 6e 6e 48 61 6e 64 | 6c 65 20 63 6f 6e 6e 2c |ConnHand|le conn,|
|00001120| 20 76 6f 69 64 2a 20 62 | 75 66 66 65 72 2c 20 6c | void* b|uffer, l|
|00001130| 6f 6e 67 20 63 6f 75 6e | 74 29 20 7b 0d 09 72 65 |ong coun|t) {..re|
|00001140| 74 75 72 6e 20 43 4d 57 | 72 69 74 65 28 63 6f 6e |turn CMW|rite(con|
|00001150| 6e 2c 20 62 75 66 66 65 | 72 2c 20 26 63 6f 75 6e |n, buffe|r, &coun|
|00001160| 74 2c 20 63 6d 44 61 74 | 61 2c 20 66 61 6c 73 65 |t, cmDat|a, false|
|00001170| 2c 20 4e 55 4c 4c 2c 20 | 35 2a 36 30 2a 36 30 2c |, NULL, |5*60*60,|
|00001180| 20 30 29 3b 0d 7d 0d 0d | 4f 53 45 72 72 20 43 6f | 0);.}..|OSErr Co|
|00001190| 6e 6e 53 65 6e 64 41 73 | 79 6e 63 28 43 6f 6e 6e |nnSendAs|ync(Conn|
|000011a0| 48 61 6e 64 6c 65 20 63 | 6f 6e 6e 2c 20 76 6f 69 |Handle c|onn, voi|
|000011b0| 64 2a 20 62 75 66 66 65 | 72 2c 20 6c 6f 6e 67 20 |d* buffe|r, long |
|000011c0| 63 6f 75 6e 74 29 20 7b | 0d 09 73 74 61 74 69 63 |count) {|..static|
|000011d0| 20 6c 6f 6e 67 20 6f 75 | 74 63 6f 75 6e 74 3b 0d | long ou|tcount;.|
|000011e0| 09 6f 75 74 63 6f 75 6e | 74 20 3d 20 63 6f 75 6e |.outcoun|t = coun|
|000011f0| 74 3b 0d 09 72 65 74 75 | 72 6e 20 43 4d 57 72 69 |t;..retu|rn CMWri|
|00001200| 74 65 28 63 6f 6e 6e 2c | 20 62 75 66 66 65 72 2c |te(conn,| buffer,|
|00001210| 20 26 6f 75 74 63 6f 75 | 6e 74 2c 20 63 6d 44 61 | &outcou|nt, cmDa|
|00001220| 74 61 2c 20 74 72 75 65 | 2c 20 4e 55 4c 4c 2c 20 |ta, true|, NULL, |
|00001230| 35 2a 36 30 2a 36 30 2c | 20 30 29 3b 0d 7d 0d 0d |5*60*60,| 0);.}..|
|00001240| 42 6f 6f 6c 65 61 6e 20 | 43 6f 6e 6e 53 65 6e 64 |Boolean |ConnSend|
|00001250| 41 73 79 6e 63 44 6f 6e | 65 28 43 6f 6e 6e 48 61 |AsyncDon|e(ConnHa|
|00001260| 6e 64 6c 65 20 63 6f 6e | 6e 29 20 7b 0d 09 43 4d |ndle con|n) {..CM|
|00001270| 42 75 66 66 65 72 53 69 | 7a 65 73 20 73 69 7a 65 |BufferSi|zes size|
|00001280| 73 3b 0d 09 43 4d 53 74 | 61 74 46 6c 61 67 73 20 |s;..CMSt|atFlags |
|00001290| 66 6c 61 67 73 3b 0d 09 | 43 4d 53 74 61 74 75 73 |flags;..|CMStatus|
|000012a0| 28 63 6f 6e 6e 2c 20 73 | 69 7a 65 73 2c 20 26 66 |(conn, s|izes, &f|
|000012b0| 6c 61 67 73 29 3b 0d 09 | 72 65 74 75 72 6e 20 28 |lags);..|return (|
|000012c0| 28 66 6c 61 67 73 20 26 | 20 63 6d 53 74 61 74 75 |(flags &| cmStatu|
|000012d0| 73 44 57 50 65 6e 64 29 | 20 3d 3d 20 30 29 3b 0d |sDWPend)| == 0);.|
|000012e0| 7d 0d 0d 4f 53 45 72 72 | 20 43 6f 6e 6e 52 65 63 |}..OSErr| ConnRec|
|000012f0| 65 69 76 65 28 43 6f 6e | 6e 48 61 6e 64 6c 65 20 |eive(Con|nHandle |
|00001300| 63 6f 6e 6e 2c 20 76 6f | 69 64 2a 20 62 75 66 66 |conn, vo|id* buff|
|00001310| 65 72 2c 20 6c 6f 6e 67 | 20 63 6f 75 6e 74 29 20 |er, long| count) |
|00001320| 7b 0d 09 43 4d 46 6c 61 | 67 73 20 66 6c 61 67 73 |{..CMFla|gs flags|
|00001330| 3b 0d 09 72 65 74 75 72 | 6e 20 43 4d 52 65 61 64 |;..retur|n CMRead|
|00001340| 28 63 6f 6e 6e 2c 20 62 | 75 66 66 65 72 2c 20 26 |(conn, b|uffer, &|
|00001350| 63 6f 75 6e 74 2c 20 63 | 6d 44 61 74 61 2c 20 66 |count, c|mData, f|
|00001360| 61 6c 73 65 2c 20 4e 55 | 4c 4c 2c 20 35 2a 36 30 |alse, NU|LL, 5*60|
|00001370| 2a 36 30 2c 20 26 66 6c | 61 67 73 29 3b 0d 7d 0d |*60, &fl|ags);.}.|
|00001380| 0d 6c 6f 6e 67 20 43 6f | 6e 6e 41 76 61 69 6c 28 |.long Co|nnAvail(|
|00001390| 43 6f 6e 6e 48 61 6e 64 | 6c 65 20 63 6f 6e 6e 29 |ConnHand|le conn)|
|000013a0| 20 7b 20 2f 2f 20 62 79 | 74 65 73 20 61 76 61 69 | { // by|tes avai|
|000013b0| 6c 61 62 6c 65 0d 09 43 | 4d 53 74 61 74 46 6c 61 |lable..C|MStatFla|
|000013c0| 67 73 20 66 6c 61 67 73 | 3b 0d 09 43 4d 42 75 66 |gs flags|;..CMBuf|
|000013d0| 66 65 72 53 69 7a 65 73 | 20 73 69 7a 65 73 3b 0d |ferSizes| sizes;.|
|000013e0| 09 69 66 20 28 43 4d 53 | 74 61 74 75 73 28 63 6f |.if (CMS|tatus(co|
|000013f0| 6e 6e 2c 20 73 69 7a 65 | 73 2c 20 26 66 6c 61 67 |nn, size|s, &flag|
|00001400| 73 29 20 21 3d 20 6e 6f | 45 72 72 29 20 72 65 74 |s) != no|Err) ret|
|00001410| 75 72 6e 20 30 3b 0d 09 | 69 66 20 28 28 66 6c 61 |urn 0;..|if ((fla|
|00001420| 67 73 20 26 20 63 6d 53 | 74 61 74 75 73 44 61 74 |gs & cmS|tatusDat|
|00001430| 61 41 76 61 69 6c 29 20 | 21 3d 20 30 29 0d 09 09 |aAvail) |!= 0)...|
|00001440| 72 65 74 75 72 6e 20 73 | 69 7a 65 73 5b 63 6d 44 |return s|izes[cmD|
|00001450| 61 74 61 49 6e 5d 3b 0d | 09 65 6c 73 65 20 72 65 |ataIn];.|.else re|
|00001460| 74 75 72 6e 20 30 3b 0d | 7d 0d 0d 6c 6f 6e 67 20 |turn 0;.|}..long |
|00001470| 47 65 74 43 6f 6e 6e 57 | 69 64 74 68 28 43 6f 6e |GetConnW|idth(Con|
|00001480| 6e 48 61 6e 64 6c 65 20 | 63 6f 6e 6e 29 20 7b 0d |nHandle |conn) {.|
|00001490| 09 43 6f 6e 6e 45 6e 76 | 69 72 6f 6e 52 65 63 20 |.ConnEnv|ironRec |
|000014a0| 65 6e 76 3b 0d 09 43 4d | 47 65 74 43 6f 6e 6e 45 |env;..CM|GetConnE|
|000014b0| 6e 76 69 72 6f 6e 73 28 | 63 6f 6e 6e 2c 20 26 65 |nvirons(|conn, &e|
|000014c0| 6e 76 29 3b 0d 09 72 65 | 74 75 72 6e 20 65 6e 76 |nv);..re|turn env|
|000014d0| 2e 64 61 74 61 42 69 74 | 73 3b 0d 7d 0d 0d 6c 6f |.dataBit|s;.}..lo|
|000014e0| 6e 67 20 47 65 74 43 6f | 6e 6e 42 61 75 64 28 43 |ng GetCo|nnBaud(C|
|000014f0| 6f 6e 6e 48 61 6e 64 6c | 65 20 63 6f 6e 6e 29 20 |onnHandl|e conn) |
|00001500| 7b 0d 09 43 6f 6e 6e 45 | 6e 76 69 72 6f 6e 52 65 |{..ConnE|nvironRe|
|00001510| 63 20 65 6e 76 3b 0d 09 | 43 4d 47 65 74 43 6f 6e |c env;..|CMGetCon|
|00001520| 6e 45 6e 76 69 72 6f 6e | 73 28 63 6f 6e 6e 2c 20 |nEnviron|s(conn, |
|00001530| 26 65 6e 76 29 3b 0d 09 | 72 65 74 75 72 6e 20 65 |&env);..|return e|
|00001540| 6e 76 2e 62 61 75 64 52 | 61 74 65 3b 0d 7d 0d 0d |nv.baudR|ate;.}..|
|00001550| 0d 4f 53 45 72 72 20 47 | 65 74 46 54 54 43 6f 6e |.OSErr G|etFTTCon|
|00001560| 66 69 67 75 72 61 74 69 | 6f 6e 28 46 54 48 61 6e |figurati|on(FTHan|
|00001570| 64 6c 65 20 66 74 74 2c | 20 42 6f 6f 6c 65 61 6e |dle ftt,| Boolean|
|00001580| 20 2a 63 68 61 6e 67 65 | 64 2c 20 48 61 6e 64 6c | *change|d, Handl|
|00001590| 65 20 63 68 29 20 7b 0d | 09 53 74 72 32 35 35 20 |e ch) {.|.Str255 |
|000015a0| 74 6f 6f 6c 5f 6e 61 6d | 65 3b 0d 09 63 68 61 72 |tool_nam|e;..char|
|000015b0| 2a 20 63 6f 6e 66 69 67 | 5f 74 65 78 74 3b 0d 09 |* config|_text;..|
|000015c0| 4f 53 45 72 72 20 65 72 | 72 3b 0d 09 63 68 61 72 |OSErr er|r;..char|
|000015d0| 20 73 74 61 74 65 3b 0d | 09 42 6f 6f 6c 65 61 6e | state;.|.Boolean|
|000015e0| 20 73 74 61 74 65 73 61 | 76 65 64 3b 0d 09 48 61 | statesa|ved;..Ha|
|000015f0| 6e 64 6c 65 20 6e 65 77 | 63 6f 6e 66 69 67 3b 0d |ndle new|config;.|
|00001600| 09 0d 09 09 2f 2a 20 69 | 6e 69 74 69 61 6c 20 73 |..../* i|nitial s|
|00001610| 74 61 74 65 20 2a 2f 0d | 09 63 6f 6e 66 69 67 5f |tate */.|.config_|
|00001620| 74 65 78 74 20 3d 20 4e | 55 4c 4c 3b 0d 09 6e 65 |text = N|ULL;..ne|
|00001630| 77 63 6f 6e 66 69 67 20 | 3d 20 4e 55 4c 4c 3b 0d |wconfig |= NULL;.|
|00001640| 09 73 74 61 74 65 73 61 | 76 65 64 20 3d 20 66 61 |.statesa|ved = fa|
|00001650| 6c 73 65 3b 0d 09 09 0d | 09 09 2f 2a 20 67 65 74 |lse;....|../* get|
|00001660| 20 74 68 65 20 74 6f 6f | 6c 20 6e 61 6d 65 20 61 | the too|l name a|
|00001670| 6e 64 20 74 68 65 20 63 | 6f 6e 66 69 67 75 72 61 |nd the c|onfigura|
|00001680| 74 69 6f 6e 20 2a 2f 0d | 09 43 4d 47 65 74 54 6f |tion */.|.CMGetTo|
|00001690| 6f 6c 4e 61 6d 65 28 28 | 2a 66 74 74 29 2d 3e 70 |olName((|*ftt)->p|
|000016a0| 72 6f 63 49 44 2c 20 74 | 6f 6f 6c 5f 6e 61 6d 65 |rocID, t|ool_name|
|000016b0| 29 3b 0d 09 63 6f 6e 66 | 69 67 5f 74 65 78 74 20 |);..conf|ig_text |
|000016c0| 3d 20 28 63 68 61 72 2a | 29 20 46 54 47 65 74 43 |= (char*|) FTGetC|
|000016d0| 6f 6e 66 69 67 28 66 74 | 74 29 3b 0d 09 69 66 20 |onfig(ft|t);..if |
|000016e0| 28 63 6f 6e 66 69 67 5f | 74 65 78 74 20 3d 3d 20 |(config_|text == |
|000016f0| 4e 55 4c 4c 29 20 7b 20 | 65 72 72 20 3d 20 70 61 |NULL) { |err = pa|
|00001700| 72 61 6d 45 72 72 3b 20 | 67 6f 74 6f 20 62 61 69 |ramErr; |goto bai|
|00001710| 6c 3b 20 7d 0d 09 09 0d | 09 09 2f 2a 20 63 61 74 |l; }....|../* cat|
|00001720| 65 6e 61 74 65 20 74 68 | 65 20 69 74 65 6d 73 20 |enate th|e items |
|00001730| 69 6e 74 6f 20 61 20 68 | 61 6e 64 6c 65 20 2a 2f |into a h|andle */|
|00001740| 0d 09 69 66 20 28 28 65 | 72 72 20 3d 20 50 74 72 |..if ((e|rr = Ptr|
|00001750| 54 6f 48 61 6e 64 28 74 | 6f 6f 6c 5f 6e 61 6d 65 |ToHand(t|ool_name|
|00001760| 2c 20 26 6e 65 77 63 6f | 6e 66 69 67 2c 20 74 6f |, &newco|nfig, to|
|00001770| 6f 6c 5f 6e 61 6d 65 5b | 30 5d 2b 31 29 29 20 21 |ol_name[|0]+1)) !|
|00001780| 3d 20 6e 6f 45 72 72 29 | 20 67 6f 74 6f 20 62 61 |= noErr)| goto ba|
|00001790| 69 6c 3b 0d 09 69 66 20 | 28 28 65 72 72 20 3d 20 |il;..if |((err = |
|000017a0| 50 74 72 41 6e 64 48 61 | 6e 64 28 63 6f 6e 66 69 |PtrAndHa|nd(confi|
|000017b0| 67 5f 74 65 78 74 2c 20 | 6e 65 77 63 6f 6e 66 69 |g_text, |newconfi|
|000017c0| 67 2c 20 73 74 72 6c 65 | 6e 28 63 6f 6e 66 69 67 |g, strle|n(config|
|000017d0| 5f 74 65 78 74 29 2b 31 | 29 29 20 21 3d 20 6e 6f |_text)+1|)) != no|
|000017e0| 45 72 72 29 20 67 6f 74 | 6f 20 62 61 69 6c 3b 0d |Err) got|o bail;.|
|000017f0| 09 48 4c 6f 63 6b 28 6e | 65 77 63 6f 6e 66 69 67 |.HLock(n|ewconfig|
|00001800| 29 3b 0d 09 73 74 61 74 | 65 20 3d 20 48 47 65 74 |);..stat|e = HGet|
|00001810| 53 74 61 74 65 28 63 68 | 29 3b 0d 09 73 74 61 74 |State(ch|);..stat|
|00001820| 65 73 61 76 65 64 20 3d | 20 74 72 75 65 3b 0d 09 |esaved =| true;..|
|00001830| 48 4c 6f 63 6b 28 63 68 | 29 3b 0d 09 69 66 20 28 |HLock(ch|);..if (|
|00001840| 47 65 74 48 61 6e 64 6c | 65 53 69 7a 65 28 63 68 |GetHandl|eSize(ch|
|00001850| 29 20 21 3d 20 47 65 74 | 48 61 6e 64 6c 65 53 69 |) != Get|HandleSi|
|00001860| 7a 65 28 6e 65 77 63 6f | 6e 66 69 67 29 0d 09 7c |ze(newco|nfig)..||
|00001870| 7c 20 6d 65 6d 63 6d 70 | 28 2a 6e 65 77 63 6f 6e || memcmp|(*newcon|
|00001880| 66 69 67 2c 20 2a 63 68 | 2c 20 47 65 74 48 61 6e |fig, *ch|, GetHan|
|00001890| 64 6c 65 53 69 7a 65 28 | 63 68 29 29 20 21 3d 20 |dleSize(|ch)) != |
|000018a0| 30 29 20 7b 0d 09 09 48 | 55 6e 6c 6f 63 6b 28 63 |0) {...H|Unlock(c|
|000018b0| 68 29 3b 0d 09 09 69 66 | 20 28 28 65 72 72 20 3d |h);...if| ((err =|
|000018c0| 20 50 74 72 54 6f 58 48 | 61 6e 64 28 2a 6e 65 77 | PtrToXH|and(*new|
|000018d0| 63 6f 6e 66 69 67 2c 20 | 63 68 2c 20 47 65 74 48 |config, |ch, GetH|
|000018e0| 61 6e 64 6c 65 53 69 7a | 65 28 6e 65 77 63 6f 6e |andleSiz|e(newcon|
|000018f0| 66 69 67 29 29 29 20 21 | 3d 20 6e 6f 45 72 72 29 |fig))) !|= noErr)|
|00001900| 20 67 6f 74 6f 20 62 61 | 69 6c 3b 0d 09 09 2a 63 | goto ba|il;...*c|
|00001910| 68 61 6e 67 65 64 20 3d | 20 74 72 75 65 3b 0d 09 |hanged =| true;..|
|00001920| 7d 20 65 6c 73 65 20 2a | 63 68 61 6e 67 65 64 20 |} else *|changed |
|00001930| 3d 20 66 61 6c 73 65 3b | 0d 09 48 53 65 74 53 74 |= false;|..HSetSt|
|00001940| 61 74 65 28 63 68 2c 20 | 73 74 61 74 65 29 3b 0d |ate(ch, |state);.|
|00001950| 09 0d 09 09 2f 2a 20 63 | 6c 65 61 6e 20 75 70 20 |..../* c|lean up |
|00001960| 61 6e 64 20 67 6f 20 61 | 77 61 79 20 2a 2f 0d 09 |and go a|way */..|
|00001970| 44 69 73 70 6f 73 65 50 | 74 72 28 63 6f 6e 66 69 |DisposeP|tr(confi|
|00001980| 67 5f 74 65 78 74 29 3b | 0d 09 44 69 73 70 6f 73 |g_text);|..Dispos|
|00001990| 65 48 61 6e 64 6c 65 28 | 6e 65 77 63 6f 6e 66 69 |eHandle(|newconfi|
|000019a0| 67 29 3b 0d 09 72 65 74 | 75 72 6e 20 6e 6f 45 72 |g);..ret|urn noEr|
|000019b0| 72 3b 0d 0d 62 61 69 6c | 3a 0d 09 69 66 20 28 6e |r;..bail|:..if (n|
|000019c0| 65 77 63 6f 6e 66 69 67 | 20 21 3d 20 4e 55 4c 4c |ewconfig| != NULL|
|000019d0| 29 20 44 69 73 70 6f 73 | 65 48 61 6e 64 6c 65 28 |) Dispos|eHandle(|
|000019e0| 6e 65 77 63 6f 6e 66 69 | 67 29 3b 0d 09 69 66 20 |newconfi|g);..if |
|000019f0| 28 63 6f 6e 66 69 67 5f | 74 65 78 74 20 21 3d 20 |(config_|text != |
|00001a00| 4e 55 4c 4c 29 20 44 69 | 73 70 6f 73 65 50 74 72 |NULL) Di|sposePtr|
|00001a10| 28 63 6f 6e 66 69 67 5f | 74 65 78 74 29 3b 0d 09 |(config_|text);..|
|00001a20| 69 66 20 28 73 74 61 74 | 65 73 61 76 65 64 29 20 |if (stat|esaved) |
|00001a30| 48 53 65 74 53 74 61 74 | 65 28 63 68 2c 20 73 74 |HSetStat|e(ch, st|
|00001a40| 61 74 65 29 3b 0d 09 72 | 65 74 75 72 6e 20 65 72 |ate);..r|eturn er|
|00001a50| 72 3b 0d 7d 0d 0d 70 61 | 73 63 61 6c 20 6c 6f 6e |r;.}..pa|scal lon|
|00001a60| 67 20 4d 79 46 54 53 65 | 6e 64 50 72 6f 63 28 76 |g MyFTSe|ndProc(v|
|00001a70| 6f 69 64 2a 20 74 68 65 | 50 74 72 2c 20 6c 6f 6e |oid* the|Ptr, lon|
|00001a80| 67 20 74 68 65 53 69 7a | 65 2c 20 6c 6f 6e 67 20 |g theSiz|e, long |
|00001a90| 72 65 66 63 6f 6e 2c 20 | 43 4d 43 68 61 6e 6e 65 |refcon, |CMChanne|
|00001aa0| 6c 20 63 68 61 6e 6e 65 | 6c 2c 20 43 4d 46 6c 61 |l channe|l, CMFla|
|00001ab0| 67 73 20 66 6c 61 67 73 | 29 20 7b 0d 09 43 6f 6e |gs flags|) {..Con|
|00001ac0| 6e 48 61 6e 64 6c 65 20 | 63 6f 6e 6e 3b 0d 09 4f |nHandle |conn;..O|
|00001ad0| 53 45 72 72 20 65 72 72 | 3b 0d 09 63 6f 6e 6e 20 |SErr err|;..conn |
|00001ae0| 3d 20 28 43 6f 6e 6e 48 | 61 6e 64 6c 65 29 20 72 |= (ConnH|andle) r|
|00001af0| 65 66 63 6f 6e 3b 0d 09 | 65 72 72 20 3d 20 43 4d |efcon;..|err = CM|
|00001b00| 57 72 69 74 65 28 63 6f | 6e 6e 2c 20 74 68 65 50 |Write(co|nn, theP|
|00001b10| 74 72 2c 20 26 74 68 65 | 53 69 7a 65 2c 20 63 68 |tr, &the|Size, ch|
|00001b20| 61 6e 6e 65 6c 2c 20 66 | 61 6c 73 65 2c 20 4e 55 |annel, f|alse, NU|
|00001b30| 4c 4c 2c 20 30 2c 20 66 | 6c 61 67 73 29 3b 0d 09 |LL, 0, f|lags);..|
|00001b40| 72 65 74 75 72 6e 20 74 | 68 65 53 69 7a 65 3b 20 |return t|heSize; |
|00001b50| 0d 7d 0d 0d 70 61 73 63 | 61 6c 20 6c 6f 6e 67 20 |.}..pasc|al long |
|00001b60| 4d 79 46 54 52 65 63 65 | 69 76 65 50 72 6f 63 28 |MyFTRece|iveProc(|
|00001b70| 76 6f 69 64 2a 20 74 68 | 65 50 74 72 2c 20 6c 6f |void* th|ePtr, lo|
|00001b80| 6e 67 20 74 68 65 53 69 | 7a 65 2c 20 6c 6f 6e 67 |ng theSi|ze, long|
|00001b90| 20 72 65 66 63 6f 6e 2c | 20 43 4d 43 68 61 6e 6e | refcon,| CMChann|
|00001ba0| 65 6c 20 63 68 61 6e 6e | 65 6c 2c 20 43 4d 46 6c |el chann|el, CMFl|
|00001bb0| 61 67 73 20 2a 66 6c 61 | 67 73 29 20 7b 0d 09 43 |ags *fla|gs) {..C|
|00001bc0| 6f 6e 6e 48 61 6e 64 6c | 65 20 63 6f 6e 6e 3b 0d |onnHandl|e conn;.|
|00001bd0| 09 4f 53 45 72 72 20 65 | 72 72 3b 0d 09 63 6f 6e |.OSErr e|rr;..con|
|00001be0| 6e 20 3d 20 28 43 6f 6e | 6e 48 61 6e 64 6c 65 29 |n = (Con|nHandle)|
|00001bf0| 20 72 65 66 63 6f 6e 3b | 0d 09 65 72 72 20 3d 20 | refcon;|..err = |
|00001c00| 43 4d 52 65 61 64 28 63 | 6f 6e 6e 2c 20 74 68 65 |CMRead(c|onn, the|
|00001c10| 50 74 72 2c 20 26 74 68 | 65 53 69 7a 65 2c 20 63 |Ptr, &th|eSize, c|
|00001c20| 68 61 6e 6e 65 6c 2c 20 | 66 61 6c 73 65 2c 20 4e |hannel, |false, N|
|00001c30| 55 4c 4c 2c 20 30 2c 20 | 66 6c 61 67 73 29 3b 0d |ULL, 0, |flags);.|
|00001c40| 09 72 65 74 75 72 6e 20 | 74 68 65 53 69 7a 65 3b |.return |theSize;|
|00001c50| 20 0d 7d 0d 0d 70 61 73 | 63 61 6c 20 43 4d 45 72 | .}..pas|cal CMEr|
|00001c60| 72 20 4d 79 46 54 45 6e | 76 69 72 6f 6e 73 50 72 |r MyFTEn|vironsPr|
|00001c70| 6f 63 28 6c 6f 6e 67 20 | 72 65 66 63 6f 6e 2c 20 |oc(long |refcon, |
|00001c80| 43 6f 6e 6e 45 6e 76 69 | 72 6f 6e 52 65 63 20 2a |ConnEnvi|ronRec *|
|00001c90| 74 68 65 45 6e 76 69 72 | 6f 6e 73 29 20 7b 0d 09 |theEnvir|ons) {..|
|00001ca0| 43 6f 6e 6e 48 61 6e 64 | 6c 65 20 63 6f 6e 6e 3b |ConnHand|le conn;|
|00001cb0| 0d 09 4f 53 45 72 72 20 | 65 72 72 3b 0d 09 63 6f |..OSErr |err;..co|
|00001cc0| 6e 6e 20 3d 20 28 43 6f | 6e 6e 48 61 6e 64 6c 65 |nn = (Co|nnHandle|
|00001cd0| 29 20 72 65 66 63 6f 6e | 3b 0d 09 72 65 74 75 72 |) refcon|;..retur|
|00001ce0| 6e 20 43 4d 47 65 74 43 | 6f 6e 6e 45 6e 76 69 72 |n CMGetC|onnEnvir|
|00001cf0| 6f 6e 73 28 63 6f 6e 6e | 2c 20 74 68 65 45 6e 76 |ons(conn|, theEnv|
|00001d00| 69 72 6f 6e 73 29 3b 0d | 7d 0d 0d 46 69 6c 65 54 |irons);.|}..FileT|
|00001d10| 72 61 6e 73 66 65 72 53 | 65 6e 64 55 50 50 20 67 |ransferS|endUPP g|
|00001d20| 43 54 42 53 65 6e 64 50 | 72 6f 63 3d 20 4e 55 4c |CTBSendP|roc= NUL|
|00001d30| 4c 3b 0d 46 69 6c 65 54 | 72 61 6e 73 66 65 72 52 |L;.FileT|ransferR|
|00001d40| 65 63 65 69 76 65 55 50 | 50 20 67 43 54 42 52 65 |eceiveUP|P gCTBRe|
|00001d50| 63 65 69 76 65 50 72 6f | 63 20 3d 20 4e 55 4c 4c |ceivePro|c = NULL|
|00001d60| 3b 0d 46 69 6c 65 54 72 | 61 6e 73 66 65 72 45 6e |;.FileTr|ansferEn|
|00001d70| 76 69 72 6f 6e 73 55 50 | 50 20 67 43 54 42 45 6e |vironsUP|P gCTBEn|
|00001d80| 76 69 72 6f 6e 73 50 72 | 6f 63 20 3d 20 4e 55 4c |vironsPr|oc = NUL|
|00001d90| 4c 3b 0d 0d 0d 4f 53 45 | 72 72 20 47 65 74 43 6f |L;...OSE|rr GetCo|
|00001da0| 6e 66 69 67 75 72 65 64 | 46 54 54 28 48 61 6e 64 |nfigured|FTT(Hand|
|00001db0| 6c 65 20 63 68 2c 20 46 | 54 48 61 6e 64 6c 65 20 |le ch, F|THandle |
|00001dc0| 2a 66 74 74 2c 20 43 6f | 6e 6e 48 61 6e 64 6c 65 |*ftt, Co|nnHandle|
|00001dd0| 20 63 6f 6e 6e 29 20 7b | 0d 09 75 6e 73 69 67 6e | conn) {|..unsign|
|00001de0| 65 64 20 63 68 61 72 20 | 2a 63 68 70 3b 0d 09 4f |ed char |*chp;..O|
|00001df0| 53 45 72 72 20 65 72 72 | 3b 0d 09 73 68 6f 72 74 |SErr err|;..short|
|00001e00| 20 70 72 6f 63 5f 69 64 | 3b 0d 09 63 68 61 72 20 | proc_id|;..char |
|00001e10| 63 68 5f 73 74 61 74 65 | 3b 0d 09 0d 09 09 2f 2f |ch_state|;.....//|
|00001e20| 20 a5 a5 a5 20 73 65 74 | 20 75 70 20 74 68 65 20 | ... set| up the |
|00001e30| 70 61 72 61 6d 65 74 65 | 72 73 0d 09 69 66 20 28 |paramete|rs..if (|
|00001e40| 63 68 20 3d 3d 20 4e 55 | 4c 4c 20 7c 7c 20 63 6f |ch == NU|LL || co|
|00001e50| 6e 6e 20 3d 3d 20 4e 55 | 4c 4c 29 20 72 65 74 75 |nn == NU|LL) retu|
|00001e60| 72 6e 20 70 61 72 61 6d | 45 72 72 3b 0d 09 63 68 |rn param|Err;..ch|
|00001e70| 5f 73 74 61 74 65 20 3d | 20 48 47 65 74 53 74 61 |_state =| HGetSta|
|00001e80| 74 65 28 63 68 29 3b 0d | 09 48 4c 6f 63 6b 28 63 |te(ch);.|.HLock(c|
|00001e90| 68 29 3b 0d 09 0d 09 09 | 2f 2f 20 a5 a5 a5 20 66 |h);.....|// ... f|
|00001ea0| 69 6e 64 20 74 68 65 20 | 74 6f 6f 6c 20 69 64 0d |ind the |tool id.|
|00001eb0| 09 63 68 70 20 3d 20 28 | 75 6e 73 69 67 6e 65 64 |.chp = (|unsigned|
|00001ec0| 20 63 68 61 72 2a 29 20 | 28 2a 63 68 29 3b 0d 09 | char*) |(*ch);..|
|00001ed0| 69 66 20 28 28 70 72 6f | 63 5f 69 64 20 3d 20 46 |if ((pro|c_id = F|
|00001ee0| 54 47 65 74 50 72 6f 63 | 49 44 28 63 68 70 29 29 |TGetProc|ID(chp))|
|00001ef0| 20 3d 3d 20 2d 31 29 20 | 7b 20 65 72 72 20 3d 20 | == -1) |{ err = |
|00001f00| 70 61 72 61 6d 45 72 72 | 3b 20 67 6f 74 6f 20 67 |paramErr|; goto g|
|00001f10| 65 74 66 74 74 5f 61 62 | 6f 72 74 3b 20 7d 0d 09 |etftt_ab|ort; }..|
|00001f20| 0d 09 09 2f 2f 20 a5 a5 | a5 20 63 72 65 61 74 65 |...// ..|. create|
|00001f30| 20 61 20 6e 65 77 20 66 | 74 20 72 65 63 6f 72 64 | a new f|t record|
|00001f40| 0d 09 69 66 20 28 67 43 | 54 42 53 65 6e 64 50 72 |..if (gC|TBSendPr|
|00001f50| 6f 63 20 3d 3d 20 4e 55 | 4c 4c 29 20 67 43 54 42 |oc == NU|LL) gCTB|
|00001f60| 53 65 6e 64 50 72 6f 63 | 3d 20 4e 65 77 46 69 6c |SendProc|= NewFil|
|00001f70| 65 54 72 61 6e 73 66 65 | 72 53 65 6e 64 50 72 6f |eTransfe|rSendPro|
|00001f80| 63 28 4d 79 46 54 53 65 | 6e 64 50 72 6f 63 29 3b |c(MyFTSe|ndProc);|
|00001f90| 0d 09 69 66 20 28 67 43 | 54 42 52 65 63 65 69 76 |..if (gC|TBReceiv|
|00001fa0| 65 50 72 6f 63 20 3d 3d | 20 4e 55 4c 4c 29 20 67 |eProc ==| NULL) g|
|00001fb0| 43 54 42 52 65 63 65 69 | 76 65 50 72 6f 63 20 3d |CTBRecei|veProc =|
|00001fc0| 20 4e 65 77 46 69 6c 65 | 54 72 61 6e 73 66 65 72 | NewFile|Transfer|
|00001fd0| 52 65 63 65 69 76 65 50 | 72 6f 63 28 4d 79 46 54 |ReceiveP|roc(MyFT|
|00001fe0| 52 65 63 65 69 76 65 50 | 72 6f 63 29 3b 0d 09 69 |ReceiveP|roc);..i|
|00001ff0| 66 20 28 67 43 54 42 45 | 6e 76 69 72 6f 6e 73 50 |f (gCTBE|nvironsP|
|00002000| 72 6f 63 20 3d 3d 20 4e | 55 4c 4c 29 20 67 43 54 |roc == N|ULL) gCT|
|00002010| 42 45 6e 76 69 72 6f 6e | 73 50 72 6f 63 20 3d 20 |BEnviron|sProc = |
|00002020| 4e 65 77 46 69 6c 65 54 | 72 61 6e 73 66 65 72 45 |NewFileT|ransferE|
|00002030| 6e 76 69 72 6f 6e 73 50 | 72 6f 63 28 4d 79 46 54 |nvironsP|roc(MyFT|
|00002040| 45 6e 76 69 72 6f 6e 73 | 50 72 6f 63 29 3b 0d 0d |Environs|Proc);..|
|00002050| 09 2a 66 74 74 20 3d 20 | 46 54 4e 65 77 28 70 72 |.*ftt = |FTNew(pr|
|00002060| 6f 63 5f 69 64 2c 20 66 | 74 4e 6f 4d 65 6e 75 73 |oc_id, f|tNoMenus|
|00002070| 2c 20 67 43 54 42 53 65 | 6e 64 50 72 6f 63 2c 20 |, gCTBSe|ndProc, |
|00002080| 67 43 54 42 52 65 63 65 | 69 76 65 50 72 6f 63 2c |gCTBRece|iveProc,|
|00002090| 0d 09 09 4e 55 4c 4c 2c | 20 4e 55 4c 4c 2c 20 67 |...NULL,| NULL, g|
|000020a0| 43 54 42 45 6e 76 69 72 | 6f 6e 73 50 72 6f 63 2c |CTBEnvir|onsProc,|
|000020b0| 20 20 4e 55 4c 4c 2c 20 | 28 6c 6f 6e 67 29 20 63 | NULL, |(long) c|
|000020c0| 6f 6e 6e 2c 20 30 29 3b | 0d 09 69 66 20 28 2a 66 |onn, 0);|..if (*f|
|000020d0| 74 74 20 3d 3d 20 4e 55 | 4c 4c 29 20 7b 20 65 72 |tt == NU|LL) { er|
|000020e0| 72 20 3d 20 6d 65 6d 46 | 75 6c 6c 45 72 72 3b 20 |r = memF|ullErr; |
|000020f0| 67 6f 74 6f 20 67 65 74 | 66 74 74 5f 61 62 6f 72 |goto get|ftt_abor|
|00002100| 74 3b 20 7d 0d 09 09 0d | 09 09 2f 2f 20 a5 a5 a5 |t; }....|..// ...|
|00002110| 20 73 65 74 20 74 68 65 | 20 63 6f 6e 66 69 67 75 | set the| configu|
|00002120| 72 61 74 69 6f 6e 0d 09 | 63 68 70 20 2b 3d 20 2a |ration..|chp += *|
|00002130| 63 68 70 20 2b 20 31 3b | 0d 09 46 54 53 65 74 43 |chp + 1;|..FTSetC|
|00002140| 6f 6e 66 69 67 28 2a 66 | 74 74 2c 20 63 68 70 29 |onfig(*f|tt, chp)|
|00002150| 3b 20 2f 2f 20 62 65 73 | 74 20 65 66 66 6f 72 74 |; // bes|t effort|
|00002160| 2c 20 65 72 72 6f 72 73 | 20 69 67 6e 6f 72 65 64 |, errors| ignored|
|00002170| 0d 09 09 0d 09 09 2f 2f | 20 a5 a5 a5 20 63 6c 65 |......//| ... cle|
|00002180| 61 6e 20 75 70 20 61 6e | 64 20 67 6f 20 61 77 61 |an up an|d go awa|
|00002190| 79 0d 09 48 53 65 74 53 | 74 61 74 65 28 63 68 2c |y..HSetS|tate(ch,|
|000021a0| 20 63 68 5f 73 74 61 74 | 65 29 3b 0d 09 72 65 74 | ch_stat|e);..ret|
|000021b0| 75 72 6e 20 6e 6f 45 72 | 72 3b 0d 67 65 74 66 74 |urn noEr|r;.getft|
|000021c0| 74 5f 61 62 6f 72 74 3a | 0d 09 48 53 65 74 53 74 |t_abort:|..HSetSt|
|000021d0| 61 74 65 28 63 68 2c 20 | 63 68 5f 73 74 61 74 65 |ate(ch, |ch_state|
|000021e0| 29 3b 0d 09 72 65 74 75 | 72 6e 20 65 72 72 3b 0d |);..retu|rn err;.|
|000021f0| 7d 0d 0d 4f 53 45 72 72 | 20 47 65 74 4e 65 77 46 |}..OSErr| GetNewF|
|00002200| 54 54 28 46 54 48 61 6e | 64 6c 65 20 2a 66 74 74 |TT(FTHan|dle *ftt|
|00002210| 2c 20 43 6f 6e 6e 48 61 | 6e 64 6c 65 20 63 6f 6e |, ConnHa|ndle con|
|00002220| 6e 29 20 7b 0d 09 53 74 | 72 32 35 35 20 74 6f 6f |n) {..St|r255 too|
|00002230| 6c 5f 6e 61 6d 65 3b 0d | 09 73 68 6f 72 74 20 70 |l_name;.|.short p|
|00002240| 72 6f 63 5f 69 64 3b 0d | 09 4f 53 45 72 72 20 65 |roc_id;.|.OSErr e|
|00002250| 72 72 2c 20 63 6f 6e 6e | 5f 65 72 72 3b 0d 09 50 |rr, conn|_err;..P|
|00002260| 6f 69 6e 74 20 70 74 3b | 0d 09 09 2f 2f 20 a5 a5 |oint pt;|...// ..|
|00002270| a5 20 73 65 74 20 75 70 | 20 61 20 73 61 66 65 20 |. set up| a safe |
|00002280| 73 74 61 74 65 0d 09 2a | 66 74 74 20 3d 20 4e 55 |state..*|ftt = NU|
|00002290| 4c 4c 3b 0d 09 70 74 2e | 68 20 3d 20 31 30 3b 20 |LL;..pt.|h = 10; |
|000022a0| 70 74 2e 76 20 3d 20 31 | 30 20 2b 20 47 65 74 4d |pt.v = 1|0 + GetM|
|000022b0| 42 61 72 48 65 69 67 68 | 74 28 29 3b 0d 09 09 2f |BarHeigh|t();.../|
|000022c0| 2f 20 a5 a5 a5 20 66 69 | 6e 64 20 67 65 74 20 74 |/ ... fi|nd get t|
|000022d0| 68 65 20 66 69 72 73 74 | 20 74 6f 6f 6c 27 73 20 |he first| tool's |
|000022e0| 70 72 6f 63 20 49 44 0d | 09 65 72 72 20 3d 20 43 |proc ID.|.err = C|
|000022f0| 52 4d 47 65 74 49 6e 64 | 54 6f 6f 6c 4e 61 6d 65 |RMGetInd|ToolName|
|00002300| 28 63 6c 61 73 73 46 54 | 2c 20 31 2c 20 74 6f 6f |(classFT|, 1, too|
|00002310| 6c 5f 6e 61 6d 65 29 3b | 0d 09 69 66 20 28 65 72 |l_name);|..if (er|
|00002320| 72 20 21 3d 20 6e 6f 45 | 72 72 29 20 67 6f 74 6f |r != noE|rr) goto|
|00002330| 20 67 6e 66 74 74 5f 61 | 62 6f 72 74 3b 0d 09 69 | gnftt_a|bort;..i|
|00002340| 66 20 28 28 70 72 6f 63 | 5f 69 64 20 3d 20 46 54 |f ((proc|_id = FT|
|00002350| 47 65 74 50 72 6f 63 49 | 44 28 74 6f 6f 6c 5f 6e |GetProcI|D(tool_n|
|00002360| 61 6d 65 29 29 20 3d 3d | 20 2d 31 29 20 7b 20 65 |ame)) ==| -1) { e|
|00002370| 72 72 20 3d 20 70 61 72 | 61 6d 45 72 72 3b 20 67 |rr = par|amErr; g|
|00002380| 6f 74 6f 20 67 6e 66 74 | 74 5f 61 62 6f 72 74 3b |oto gnft|t_abort;|
|00002390| 20 7d 0d 09 09 2f 2f 20 | a5 a5 a5 20 63 72 65 61 | }...// |... crea|
|000023a0| 74 65 20 61 20 6e 65 77 | 20 46 54 20 72 65 63 6f |te a new| FT reco|
|000023b0| 72 64 0d 09 69 66 20 28 | 67 43 54 42 53 65 6e 64 |rd..if (|gCTBSend|
|000023c0| 50 72 6f 63 20 3d 3d 20 | 4e 55 4c 4c 29 20 67 43 |Proc == |NULL) gC|
|000023d0| 54 42 53 65 6e 64 50 72 | 6f 63 3d 20 4e 65 77 46 |TBSendPr|oc= NewF|
|000023e0| 69 6c 65 54 72 61 6e 73 | 66 65 72 53 65 6e 64 50 |ileTrans|ferSendP|
|000023f0| 72 6f 63 28 4d 79 46 54 | 53 65 6e 64 50 72 6f 63 |roc(MyFT|SendProc|
|00002400| 29 3b 0d 09 69 66 20 28 | 67 43 54 42 52 65 63 65 |);..if (|gCTBRece|
|00002410| 69 76 65 50 72 6f 63 20 | 3d 3d 20 4e 55 4c 4c 29 |iveProc |== NULL)|
|00002420| 20 67 43 54 42 52 65 63 | 65 69 76 65 50 72 6f 63 | gCTBRec|eiveProc|
|00002430| 20 3d 20 4e 65 77 46 69 | 6c 65 54 72 61 6e 73 66 | = NewFi|leTransf|
|00002440| 65 72 52 65 63 65 69 76 | 65 50 72 6f 63 28 4d 79 |erReceiv|eProc(My|
|00002450| 46 54 52 65 63 65 69 76 | 65 50 72 6f 63 29 3b 0d |FTReceiv|eProc);.|
|00002460| 09 69 66 20 28 67 43 54 | 42 45 6e 76 69 72 6f 6e |.if (gCT|BEnviron|
|00002470| 73 50 72 6f 63 20 3d 3d | 20 4e 55 4c 4c 29 20 67 |sProc ==| NULL) g|
|00002480| 43 54 42 45 6e 76 69 72 | 6f 6e 73 50 72 6f 63 20 |CTBEnvir|onsProc |
|00002490| 3d 20 4e 65 77 46 69 6c | 65 54 72 61 6e 73 66 65 |= NewFil|eTransfe|
|000024a0| 72 45 6e 76 69 72 6f 6e | 73 50 72 6f 63 28 4d 79 |rEnviron|sProc(My|
|000024b0| 46 54 45 6e 76 69 72 6f | 6e 73 50 72 6f 63 29 3b |FTEnviro|nsProc);|
|000024c0| 0d 09 2a 66 74 74 20 3d | 20 46 54 4e 65 77 28 70 |..*ftt =| FTNew(p|
|000024d0| 72 6f 63 5f 69 64 2c 20 | 66 74 4e 6f 4d 65 6e 75 |roc_id, |ftNoMenu|
|000024e0| 73 2c 20 67 43 54 42 53 | 65 6e 64 50 72 6f 63 2c |s, gCTBS|endProc,|
|000024f0| 20 67 43 54 42 52 65 63 | 65 69 76 65 50 72 6f 63 | gCTBRec|eiveProc|
|00002500| 2c 0d 09 09 4e 55 4c 4c | 2c 20 4e 55 4c 4c 2c 20 |,...NULL|, NULL, |
|00002510| 67 43 54 42 45 6e 76 69 | 72 6f 6e 73 50 72 6f 63 |gCTBEnvi|ronsProc|
|00002520| 2c 20 20 4e 55 4c 4c 2c | 20 28 6c 6f 6e 67 29 20 |, NULL,| (long) |
|00002530| 63 6f 6e 6e 2c 20 30 29 | 3b 0d 09 69 66 20 28 2a |conn, 0)|;..if (*|
|00002540| 66 74 74 20 3d 3d 20 4e | 55 4c 4c 29 20 7b 20 65 |ftt == N|ULL) { e|
|00002550| 72 72 20 3d 20 6d 65 6d | 46 75 6c 6c 45 72 72 3b |rr = mem|FullErr;|
|00002560| 20 67 6f 74 6f 20 67 6e | 66 74 74 5f 61 62 6f 72 | goto gn|ftt_abor|
|00002570| 74 3b 20 7d 0d 0d 09 69 | 66 20 28 28 65 72 72 20 |t; }...i|f ((err |
|00002580| 3d 20 46 54 43 68 6f 6f | 73 65 28 66 74 74 2c 20 |= FTChoo|se(ftt, |
|00002590| 70 74 2c 20 4e 55 4c 4c | 29 29 20 3c 20 30 29 20 |pt, NULL|)) < 0) |
|000025a0| 67 6f 74 6f 20 67 6e 66 | 74 74 5f 61 62 6f 72 74 |goto gnf|tt_abort|
|000025b0| 3b 0d 09 72 65 74 75 72 | 6e 20 6e 6f 45 72 72 3b |;..retur|n noErr;|
|000025c0| 0d 67 6e 66 74 74 5f 61 | 62 6f 72 74 3a 0d 09 69 |.gnftt_a|bort:..i|
|000025d0| 66 20 28 2a 66 74 74 20 | 21 3d 20 4e 55 4c 4c 29 |f (*ftt |!= NULL)|
|000025e0| 20 46 54 44 69 73 70 6f | 73 65 28 2a 66 74 74 29 | FTDispo|se(*ftt)|
|000025f0| 3b 0d 09 72 65 74 75 72 | 6e 20 65 72 72 3b 0d 7d |;..retur|n err;.}|
|00002600| 0d 0d 42 6f 6f 6c 65 61 | 6e 20 46 54 54 44 6f 6e |..Boolea|n FTTDon|
|00002610| 65 54 72 61 6e 73 66 65 | 72 28 46 54 48 61 6e 64 |eTransfe|r(FTHand|
|00002620| 6c 65 20 66 74 74 29 20 | 7b 0d 09 69 66 20 28 28 |le ftt) |{..if ((|
|00002630| 28 2a 66 74 74 29 2d 3e | 66 6c 61 67 73 20 26 20 |(*ftt)->|flags & |
|00002640| 66 74 49 73 46 54 4d 6f | 64 65 29 20 3d 3d 20 30 |ftIsFTMo|de) == 0|
|00002650| 29 0d 09 09 72 65 74 75 | 72 6e 20 74 72 75 65 3b |)...retu|rn true;|
|00002660| 0d 09 65 6c 73 65 20 72 | 65 74 75 72 6e 20 66 61 |..else r|eturn fa|
|00002670| 6c 73 65 3b 0d 7d 0d 0d | 42 6f 6f 6c 65 61 6e 20 |lse;.}..|Boolean |
|00002680| 46 54 54 53 75 63 63 65 | 73 73 66 75 6c 54 72 61 |FTTSucce|ssfulTra|
|00002690| 6e 73 66 65 72 28 46 54 | 48 61 6e 64 6c 65 20 66 |nsfer(FT|Handle f|
|000026a0| 74 74 29 20 7b 0d 09 69 | 66 20 28 28 28 2a 66 74 |tt) {..i|f (((*ft|
|000026b0| 74 29 2d 3e 66 6c 61 67 | 73 20 26 20 66 74 53 75 |t)->flag|s & ftSu|
|000026c0| 63 63 29 20 21 3d 20 30 | 29 0d 09 09 72 65 74 75 |cc) != 0|)...retu|
|000026d0| 72 6e 20 74 72 75 65 3b | 0d 09 65 6c 73 65 20 72 |rn true;|..else r|
|000026e0| 65 74 75 72 6e 20 66 61 | 6c 73 65 3b 0d 7d 0d 0d |eturn fa|lse;.}..|
|000026f0| 4f 53 45 72 72 20 43 6f | 6e 6e 46 74 74 45 76 65 |OSErr Co|nnFttEve|
|00002700| 6e 74 48 6f 6f 6b 28 43 | 6f 6e 6e 48 61 6e 64 6c |ntHook(C|onnHandl|
|00002710| 65 20 63 6f 6e 6e 2c 20 | 46 54 48 61 6e 64 6c 65 |e conn, |FTHandle|
|00002720| 20 66 74 74 2c 20 43 54 | 42 45 76 65 6e 74 48 6f | ftt, CT|BEventHo|
|00002730| 6f 6b 20 68 6f 6f 6b 29 | 20 7b 0d 09 45 76 65 6e |ok hook)| {..Even|
|00002740| 74 52 65 63 6f 72 64 20 | 65 76 3b 0d 09 57 69 6e |tRecord |ev;..Win|
|00002750| 64 6f 77 50 74 72 20 77 | 70 3b 0d 09 6c 6f 6e 67 |dowPtr w|p;..long|
|00002760| 20 72 65 66 63 6f 6e 3b | 0d 09 42 6f 6f 6c 65 61 | refcon;|..Boolea|
|00002770| 6e 20 68 61 6e 64 6c 65 | 64 3b 0d 09 69 66 20 28 |n handle|d;..if (|
|00002780| 21 57 61 69 74 4e 65 78 | 74 45 76 65 6e 74 28 65 |!WaitNex|tEvent(e|
|00002790| 76 65 72 79 45 76 65 6e | 74 2c 20 26 65 76 2c 20 |veryEven|t, &ev, |
|000027a0| 30 2c 20 4e 55 4c 4c 29 | 29 20 65 76 2e 77 68 61 |0, NULL)|) ev.wha|
|000027b0| 74 20 3d 20 6e 75 6c 6c | 45 76 65 6e 74 3b 0d 09 |t = null|Event;..|
|000027c0| 73 77 69 74 63 68 20 28 | 65 76 2e 77 68 61 74 29 |switch (|ev.what)|
|000027d0| 20 7b 0d 09 09 63 61 73 | 65 20 61 63 74 69 76 61 | {...cas|e activa|
|000027e0| 74 65 45 76 74 3a 0d 09 | 09 09 77 70 20 3d 20 28 |teEvt:..|..wp = (|
|000027f0| 57 69 6e 64 6f 77 50 74 | 72 29 20 65 76 2e 6d 65 |WindowPt|r) ev.me|
|00002800| 73 73 61 67 65 3b 0d 09 | 09 09 69 66 20 28 28 72 |ssage;..|..if ((r|
|00002810| 65 66 63 6f 6e 20 3d 20 | 47 65 74 57 52 65 66 43 |efcon = |GetWRefC|
|00002820| 6f 6e 28 77 70 29 29 20 | 3d 3d 20 28 6c 6f 6e 67 |on(wp)) |== (long|
|00002830| 29 20 66 74 74 29 20 7b | 0d 09 09 09 09 46 54 41 |) ftt) {|.....FTA|
|00002840| 63 74 69 76 61 74 65 28 | 66 74 74 2c 20 65 76 2e |ctivate(|ftt, ev.|
|00002850| 6d 6f 64 69 66 69 65 72 | 73 20 26 20 61 63 74 69 |modifier|s & acti|
|00002860| 76 65 46 6c 61 67 29 3b | 0d 09 09 09 09 72 65 74 |veFlag);|.....ret|
|00002870| 75 72 6e 20 6e 6f 45 72 | 72 3b 0d 09 09 09 7d 20 |urn noEr|r;....} |
|00002880| 65 6c 73 65 20 69 66 20 | 28 72 65 66 63 6f 6e 20 |else if |(refcon |
|00002890| 3d 3d 20 28 6c 6f 6e 67 | 29 20 63 6f 6e 6e 29 20 |== (long|) conn) |
|000028a0| 7b 0d 09 09 09 09 43 4d | 41 63 74 69 76 61 74 65 |{.....CM|Activate|
|000028b0| 28 63 6f 6e 6e 2c 20 65 | 76 2e 6d 6f 64 69 66 69 |(conn, e|v.modifi|
|000028c0| 65 72 73 20 26 20 61 63 | 74 69 76 65 46 6c 61 67 |ers & ac|tiveFlag|
|000028d0| 29 3b 0d 09 09 09 09 72 | 65 74 75 72 6e 20 6e 6f |);.....r|eturn no|
|000028e0| 45 72 72 3b 0d 09 09 09 | 7d 0d 09 09 09 62 72 65 |Err;....|}....bre|
|000028f0| 61 6b 3b 0d 09 09 63 61 | 73 65 20 6f 73 45 76 74 |ak;...ca|se osEvt|
|00002900| 3a 0d 09 09 09 69 66 20 | 28 28 77 70 20 3d 20 46 |:....if |((wp = F|
|00002910| 72 6f 6e 74 57 69 6e 64 | 6f 77 28 29 29 20 21 3d |rontWind|ow()) !=|
|00002920| 20 4e 55 4c 4c 29 20 7b | 0d 09 09 09 09 69 66 20 | NULL) {|.....if |
|00002930| 28 28 72 65 66 63 6f 6e | 20 3d 20 47 65 74 57 52 |((refcon| = GetWR|
|00002940| 65 66 43 6f 6e 28 77 70 | 29 29 20 3d 3d 20 28 6c |efCon(wp|)) == (l|
|00002950| 6f 6e 67 29 20 66 74 74 | 29 20 7b 0d 09 09 09 09 |ong) ftt|) {.....|
|00002960| 09 46 54 52 65 73 75 6d | 65 28 66 74 74 2c 20 28 |.FTResum|e(ftt, (|
|00002970| 65 76 2e 6d 65 73 73 61 | 67 65 20 26 20 72 65 73 |ev.messa|ge & res|
|00002980| 75 6d 65 46 6c 61 67 29 | 20 21 3d 20 30 29 3b 0d |umeFlag)| != 0);.|
|00002990| 09 09 09 09 09 72 65 74 | 75 72 6e 20 6e 6f 45 72 |.....ret|urn noEr|
|000029a0| 72 3b 0d 09 09 09 09 7d | 20 65 6c 73 65 20 69 66 |r;.....}| else if|
|000029b0| 20 28 72 65 66 63 6f 6e | 20 3d 3d 20 28 6c 6f 6e | (refcon| == (lon|
|000029c0| 67 29 20 63 6f 6e 6e 29 | 20 7b 0d 09 09 09 09 09 |g) conn)| {......|
|000029d0| 43 4d 52 65 73 75 6d 65 | 28 63 6f 6e 6e 2c 20 28 |CMResume|(conn, (|
|000029e0| 65 76 2e 6d 65 73 73 61 | 67 65 20 26 20 72 65 73 |ev.messa|ge & res|
|000029f0| 75 6d 65 46 6c 61 67 29 | 20 21 3d 20 30 29 3b 0d |umeFlag)| != 0);.|
|00002a00| 09 09 09 09 09 72 65 74 | 75 72 6e 20 6e 6f 45 72 |.....ret|urn noEr|
|00002a10| 72 3b 0d 09 09 09 09 7d | 0d 09 09 09 7d 0d 09 09 |r;.....}|....}...|
|00002a20| 09 62 72 65 61 6b 3b 0d | 09 09 63 61 73 65 20 75 |.break;.|..case u|
|00002a30| 70 64 61 74 65 45 76 74 | 3a 0d 09 09 09 77 70 20 |pdateEvt|:....wp |
|00002a40| 3d 20 28 57 69 6e 64 6f | 77 50 74 72 29 20 65 76 |= (Windo|wPtr) ev|
|00002a50| 2e 6d 65 73 73 61 67 65 | 3b 0d 09 09 09 69 66 20 |.message|;....if |
|00002a60| 28 28 72 65 66 63 6f 6e | 20 3d 20 47 65 74 57 52 |((refcon| = GetWR|
|00002a70| 65 66 43 6f 6e 28 77 70 | 29 29 20 3d 3d 20 28 6c |efCon(wp|)) == (l|
|00002a80| 6f 6e 67 29 20 66 74 74 | 29 20 7b 0d 09 09 09 09 |ong) ftt|) {.....|
|00002a90| 46 54 45 76 65 6e 74 28 | 66 74 74 2c 20 26 65 76 |FTEvent(|ftt, &ev|
|00002aa0| 29 3b 0d 09 09 09 09 72 | 65 74 75 72 6e 20 6e 6f |);.....r|eturn no|
|00002ab0| 45 72 72 3b 0d 09 09 09 | 7d 20 65 6c 73 65 20 69 |Err;....|} else i|
|00002ac0| 66 20 28 72 65 66 63 6f | 6e 20 3d 3d 20 28 6c 6f |f (refco|n == (lo|
|00002ad0| 6e 67 29 20 63 6f 6e 6e | 29 20 7b 0d 09 09 09 09 |ng) conn|) {.....|
|00002ae0| 43 4d 45 76 65 6e 74 28 | 63 6f 6e 6e 2c 20 26 65 |CMEvent(|conn, &e|
|00002af0| 76 29 3b 0d 09 09 09 09 | 72 65 74 75 72 6e 20 6e |v);.....|return n|
|00002b00| 6f 45 72 72 3b 0d 09 09 | 09 7d 0d 09 09 09 62 72 |oErr;...|.}....br|
|00002b10| 65 61 6b 3b 0d 09 09 63 | 61 73 65 20 6d 6f 75 73 |eak;...c|ase mous|
|00002b20| 65 44 6f 77 6e 3a 0d 09 | 09 09 69 66 20 28 46 69 |eDown:..|..if (Fi|
|00002b30| 6e 64 57 69 6e 64 6f 77 | 28 65 76 2e 77 68 65 72 |ndWindow|(ev.wher|
|00002b40| 65 2c 20 26 77 70 29 20 | 3d 3d 20 69 6e 43 6f 6e |e, &wp) |== inCon|
|00002b50| 74 65 6e 74 29 20 7b 0d | 09 09 09 09 69 66 20 28 |tent) {.|....if (|
|00002b60| 28 72 65 66 63 6f 6e 20 | 3d 20 47 65 74 57 52 65 |(refcon |= GetWRe|
|00002b70| 66 43 6f 6e 28 77 70 29 | 29 20 3d 3d 20 28 6c 6f |fCon(wp)|) == (lo|
|00002b80| 6e 67 29 20 66 74 74 29 | 20 7b 0d 09 09 09 09 09 |ng) ftt)| {......|
|00002b90| 46 54 45 76 65 6e 74 28 | 66 74 74 2c 20 26 65 76 |FTEvent(|ftt, &ev|
|00002ba0| 29 3b 0d 09 09 09 09 09 | 72 65 74 75 72 6e 20 6e |);......|return n|
|00002bb0| 6f 45 72 72 3b 0d 09 09 | 09 09 7d 20 65 6c 73 65 |oErr;...|..} else|
|00002bc0| 20 69 66 20 28 72 65 66 | 63 6f 6e 20 3d 3d 20 28 | if (ref|con == (|
|00002bd0| 6c 6f 6e 67 29 20 63 6f | 6e 6e 29 20 7b 0d 09 09 |long) co|nn) {...|
|00002be0| 09 09 09 43 4d 45 76 65 | 6e 74 28 63 6f 6e 6e 2c |...CMEve|nt(conn,|
|00002bf0| 20 26 65 76 29 3b 0d 09 | 09 09 09 09 72 65 74 75 | &ev);..|....retu|
|00002c00| 72 6e 20 6e 6f 45 72 72 | 3b 0d 09 09 09 09 7d 0d |rn noErr|;.....}.|
|00002c10| 09 09 09 7d 0d 09 09 09 | 62 72 65 61 6b 3b 0d 09 |...}....|break;..|
|00002c20| 09 63 61 73 65 20 6b 65 | 79 44 6f 77 6e 3a 0d 09 |.case ke|yDown:..|
|00002c30| 09 63 61 73 65 20 61 75 | 74 6f 4b 65 79 3a 0d 09 |.case au|toKey:..|
|00002c40| 09 09 69 66 20 28 28 77 | 70 20 3d 20 46 72 6f 6e |..if ((w|p = Fron|
|00002c50| 74 57 69 6e 64 6f 77 28 | 29 29 20 21 3d 20 4e 55 |tWindow(|)) != NU|
|00002c60| 4c 4c 29 20 7b 0d 09 09 | 09 09 69 66 20 28 28 72 |LL) {...|..if ((r|
|00002c70| 65 66 63 6f 6e 20 3d 20 | 47 65 74 57 52 65 66 43 |efcon = |GetWRefC|
|00002c80| 6f 6e 28 77 70 29 29 20 | 3d 3d 20 28 6c 6f 6e 67 |on(wp)) |== (long|
|00002c90| 29 20 66 74 74 29 20 7b | 0d 09 09 09 09 09 46 54 |) ftt) {|......FT|
|00002ca0| 45 76 65 6e 74 28 66 74 | 74 2c 20 26 65 76 29 3b |Event(ft|t, &ev);|
|00002cb0| 0d 09 09 09 09 09 72 65 | 74 75 72 6e 20 6e 6f 45 |......re|turn noE|
|00002cc0| 72 72 3b 0d 09 09 09 09 | 7d 20 65 6c 73 65 20 69 |rr;.....|} else i|
|00002cd0| 66 20 28 72 65 66 63 6f | 6e 20 3d 3d 20 28 6c 6f |f (refco|n == (lo|
|00002ce0| 6e 67 29 20 63 6f 6e 6e | 29 20 7b 0d 09 09 09 09 |ng) conn|) {.....|
|00002cf0| 09 43 4d 45 76 65 6e 74 | 28 63 6f 6e 6e 2c 20 26 |.CMEvent|(conn, &|
|00002d00| 65 76 29 3b 0d 09 09 09 | 09 09 72 65 74 75 72 6e |ev);....|..return|
|00002d10| 20 6e 6f 45 72 72 3b 0d | 09 09 09 09 7d 0d 09 09 | noErr;.|....}...|
|00002d20| 09 7d 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 7d 0d |.}....br|eak;..}.|
|00002d30| 09 69 66 20 28 68 6f 6f | 6b 20 21 3d 20 4e 55 4c |.if (hoo|k != NUL|
|00002d40| 4c 29 0d 09 09 72 65 74 | 75 72 6e 20 68 6f 6f 6b |L)...ret|urn hook|
|00002d50| 28 26 65 76 29 3b 0d 09 | 65 6c 73 65 20 72 65 74 |(&ev);..|else ret|
|00002d60| 75 72 6e 20 6e 6f 45 72 | 72 3b 0d 7d 0d 0d 4f 53 |urn noEr|r;.}..OS|
|00002d70| 45 72 72 20 53 69 6d 70 | 6c 65 52 65 63 65 69 76 |Err Simp|leReceiv|
|00002d80| 65 46 69 6c 65 28 43 6f | 6e 6e 48 61 6e 64 6c 65 |eFile(Co|nnHandle|
|00002d90| 20 63 6f 6e 6e 2c 20 73 | 68 6f 72 74 20 66 74 74 | conn, s|hort ftt|
|00002da0| 63 49 44 2c 20 42 6f 6f | 6c 65 61 6e 20 73 68 6f |cID, Boo|lean sho|
|00002db0| 77 70 72 6f 67 72 65 73 | 73 2c 20 43 54 42 45 76 |wprogres|s, CTBEv|
|00002dc0| 65 6e 74 48 6f 6f 6b 20 | 68 6f 6f 6b 2c 20 73 68 |entHook |hook, sh|
|00002dd0| 6f 72 74 20 76 6f 6c 2c | 20 6c 6f 6e 67 20 64 69 |ort vol,| long di|
|00002de0| 72 2c 20 53 74 72 69 6e | 67 50 74 72 20 6e 61 6d |r, Strin|gPtr nam|
|00002df0| 65 29 20 7b 0d 09 46 54 | 48 61 6e 64 6c 65 20 66 |e) {..FT|Handle f|
|00002e00| 74 74 3b 0d 09 53 46 52 | 65 70 6c 79 20 66 69 6c |tt;..SFR|eply fil|
|00002e10| 65 69 6e 66 6f 3b 0d 09 | 48 61 6e 64 6c 65 20 66 |einfo;..|Handle f|
|00002e20| 74 74 63 6f 6e 66 69 67 | 2c 20 68 3b 0d 09 4f 53 |ttconfig|, h;..OS|
|00002e30| 45 72 72 20 65 72 72 3b | 0d 09 52 65 63 74 20 62 |Err err;|..Rect b|
|00002e40| 6f 75 6e 64 73 3b 0d 09 | 57 69 6e 64 6f 77 50 74 |ounds;..|WindowPt|
|00002e50| 72 20 64 75 6d 6d 79 3b | 0d 09 73 68 6f 72 74 20 |r dummy;|..short |
|00002e60| 77 64 6e 75 6d 3b 0d 09 | 6c 6f 6e 67 20 74 65 6d |wdnum;..|long tem|
|00002e70| 70 64 69 72 2c 20 72 65 | 6e 61 6d 65 63 6f 75 6e |pdir, re|namecoun|
|00002e80| 74 3b 0d 09 53 74 72 32 | 35 35 20 74 65 6d 70 64 |t;..Str2|55 tempd|
|00002e90| 69 72 6e 61 6d 65 3b 0d | 09 53 74 72 36 33 20 6e |irname;.|.Str63 n|
|00002ea0| 65 77 4e 61 6d 65 2c 20 | 73 3b 0d 09 48 46 69 6c |ewName, |s;..HFil|
|00002eb0| 65 50 61 72 61 6d 20 66 | 70 3b 0d 09 75 6e 73 69 |eParam f|p;..unsi|
|00002ec0| 67 6e 65 64 20 6c 6f 6e | 67 20 6e 6f 77 3b 0d 09 |gned lon|g now;..|
|00002ed0| 0d 09 09 2f 2a 20 73 65 | 74 20 75 70 20 61 20 73 |.../* se|t up a s|
|00002ee0| 61 66 65 20 73 74 61 74 | 65 20 2a 2f 0d 09 66 74 |afe stat|e */..ft|
|00002ef0| 74 20 3d 20 4e 55 4c 4c | 3b 0d 09 77 64 6e 75 6d |t = NULL|;..wdnum|
|00002f00| 20 3d 20 30 3b 0d 09 64 | 75 6d 6d 79 20 3d 20 4e | = 0;..d|ummy = N|
|00002f10| 55 4c 4c 3b 0d 09 74 65 | 6d 70 64 69 72 20 3d 20 |ULL;..te|mpdir = |
|00002f20| 30 3b 0d 09 0d 09 09 2f | 2a 20 63 72 65 61 74 65 |0;...../|* create|
|00002f30| 20 61 20 74 65 6d 70 6f | 72 61 72 79 2c 20 65 6d | a tempo|rary, em|
|00002f40| 70 74 79 20 64 69 72 65 | 63 74 6f 72 79 20 2a 2f |pty dire|ctory */|
|00002f50| 0d 09 47 65 74 44 61 74 | 65 54 69 6d 65 28 26 6e |..GetDat|eTime(&n|
|00002f60| 6f 77 29 3b 0d 09 4e 75 | 6d 54 6f 53 74 72 69 6e |ow);..Nu|mToStrin|
|00002f70| 67 28 6e 6f 77 2b 2b 2c | 20 74 65 6d 70 64 69 72 |g(now++,| tempdir|
|00002f80| 6e 61 6d 65 29 3b 0d 09 | 77 68 69 6c 65 20 28 28 |name);..|while ((|
|00002f90| 65 72 72 20 3d 20 44 69 | 72 43 72 65 61 74 65 28 |err = Di|rCreate(|
|00002fa0| 76 6f 6c 2c 20 64 69 72 | 2c 20 74 65 6d 70 64 69 |vol, dir|, tempdi|
|00002fb0| 72 6e 61 6d 65 2c 20 26 | 74 65 6d 70 64 69 72 29 |rname, &|tempdir)|
|00002fc0| 29 20 3d 3d 20 64 75 70 | 46 4e 45 72 72 29 0d 09 |) == dup|FNErr)..|
|00002fd0| 09 4e 75 6d 54 6f 53 74 | 72 69 6e 67 28 6e 6f 77 |.NumToSt|ring(now|
|00002fe0| 2b 2b 2c 20 74 65 6d 70 | 64 69 72 6e 61 6d 65 29 |++, temp|dirname)|
|00002ff0| 3b 0d 09 69 66 20 28 65 | 72 72 20 21 3d 20 6e 6f |;..if (e|rr != no|
|00003000| 45 72 72 29 20 67 6f 74 | 6f 20 62 61 69 6c 3b 0d |Err) got|o bail;.|
|00003010| 09 0d 09 09 2f 2a 20 73 | 65 74 20 75 70 20 74 68 |..../* s|et up th|
|00003020| 65 20 72 65 63 65 69 76 | 65 20 6c 6f 63 61 74 69 |e receiv|e locati|
|00003030| 6f 6e 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 2a |on infor|mation *|
|00003040| 2f 0d 09 6d 65 6d 73 65 | 74 28 26 66 69 6c 65 69 |/..memse|t(&filei|
|00003050| 6e 66 6f 2c 20 30 2c 20 | 73 69 7a 65 6f 66 28 66 |nfo, 0, |sizeof(f|
|00003060| 69 6c 65 69 6e 66 6f 29 | 29 3b 0d 09 65 72 72 20 |ileinfo)|);..err |
|00003070| 3d 20 4f 70 65 6e 57 44 | 28 76 6f 6c 2c 20 74 65 |= OpenWD|(vol, te|
|00003080| 6d 70 64 69 72 2c 20 27 | 46 54 54 43 27 2c 20 26 |mpdir, '|FTTC', &|
|00003090| 77 64 6e 75 6d 29 3b 0d | 09 69 66 20 28 65 72 72 |wdnum);.|.if (err|
|000030a0| 20 21 3d 20 6e 6f 45 72 | 72 29 20 67 6f 74 6f 20 | != noEr|r) goto |
|000030b0| 62 61 69 6c 3b 0d 09 66 | 69 6c 65 69 6e 66 6f 2e |bail;..f|ileinfo.|
|000030c0| 67 6f 6f 64 20 3d 20 74 | 72 75 65 3b 0d 09 66 69 |good = t|rue;..fi|
|000030d0| 6c 65 69 6e 66 6f 2e 66 | 54 79 70 65 20 3d 20 27 |leinfo.f|Type = '|
|000030e0| 44 41 54 41 27 3b 0d 09 | 50 4c 73 74 72 63 70 79 |DATA';..|PLstrcpy|
|000030f0| 28 66 69 6c 65 69 6e 66 | 6f 2e 66 4e 61 6d 65 2c |(fileinf|o.fName,|
|00003100| 20 6e 61 6d 65 29 3b 0d | 09 66 69 6c 65 69 6e 66 | name);.|.fileinf|
|00003110| 6f 2e 76 52 65 66 4e 75 | 6d 20 3d 20 77 64 6e 75 |o.vRefNu|m = wdnu|
|00003120| 6d 3b 0d 0d 09 09 2f 2a | 20 67 65 74 20 74 68 65 |m;..../*| get the|
|00003130| 20 66 69 6c 65 20 74 72 | 61 6e 73 66 65 72 20 74 | file tr|ansfer t|
|00003140| 6f 6f 6c 20 2a 2f 0d 09 | 66 74 74 63 6f 6e 66 69 |ool */..|fttconfi|
|00003150| 67 20 3d 20 47 65 74 52 | 65 73 6f 75 72 63 65 28 |g = GetR|esource(|
|00003160| 72 46 69 6c 65 54 43 6f | 6e 66 69 67 2c 20 66 74 |rFileTCo|nfig, ft|
|00003170| 74 63 49 44 29 3b 0d 09 | 69 66 20 28 66 74 74 63 |tcID);..|if (fttc|
|00003180| 6f 6e 66 69 67 20 3d 3d | 20 4e 55 4c 4c 29 20 7b |onfig ==| NULL) {|
|00003190| 20 65 72 72 20 3d 20 20 | 72 65 73 4e 6f 74 46 6f | err = |resNotFo|
|000031a0| 75 6e 64 3b 20 67 6f 74 | 6f 20 62 61 69 6c 3b 20 |und; got|o bail; |
|000031b0| 7d 0d 09 65 72 72 20 3d | 20 47 65 74 43 6f 6e 66 |}..err =| GetConf|
|000031c0| 69 67 75 72 65 64 46 54 | 54 28 66 74 74 63 6f 6e |iguredFT|T(fttcon|
|000031d0| 66 69 67 2c 20 26 66 74 | 74 2c 20 63 6f 6e 6e 29 |fig, &ft|t, conn)|
|000031e0| 3b 0d 09 69 66 20 28 65 | 72 72 21 3d 20 6e 6f 45 |;..if (e|rr!= noE|
|000031f0| 72 72 29 20 67 6f 74 6f | 20 62 61 69 6c 3b 0d 09 |rr) goto| bail;..|
|00003200| 0d 09 09 2f 2a 20 73 65 | 74 20 75 70 20 61 20 64 |.../* se|t up a d|
|00003210| 75 6d 6d 79 20 77 69 6e | 64 6f 77 20 66 6f 72 20 |ummy win|dow for |
|00003220| 74 68 65 20 74 6f 6f 6c | 20 74 6f 20 70 6f 73 69 |the tool| to posi|
|00003230| 74 69 6f 6e 20 69 74 27 | 73 20 77 69 6e 64 6f 77 |tion it'|s window|
|00003240| 20 2a 2f 0d 09 69 66 20 | 28 73 68 6f 77 70 72 6f | */..if |(showpro|
|00003250| 67 72 65 73 73 29 20 7b | 0d 09 09 53 65 74 52 65 |gress) {|...SetRe|
|00003260| 63 74 28 26 62 6f 75 6e | 64 73 2c 20 31 30 2c 20 |ct(&boun|ds, 10, |
|00003270| 31 30 2c 20 32 30 2c 20 | 32 30 29 3b 0d 09 09 4f |10, 20, |20);...O|
|00003280| 66 66 73 65 74 52 65 63 | 74 28 26 62 6f 75 6e 64 |ffsetRec|t(&bound|
|00003290| 73 2c 20 30 2c 20 47 65 | 74 4d 42 61 72 48 65 69 |s, 0, Ge|tMBarHei|
|000032a0| 67 68 74 28 29 29 3b 0d | 09 09 64 75 6d 6d 79 20 |ght());.|..dummy |
|000032b0| 3d 20 4e 65 77 57 69 6e | 64 6f 77 28 4e 55 4c 4c |= NewWin|dow(NULL|
|000032c0| 2c 20 26 62 6f 75 6e 64 | 73 2c 20 22 5c 70 52 65 |, &bound|s, "\pRe|
|000032d0| 63 65 69 76 65 22 2c 20 | 66 61 6c 73 65 2c 20 30 |ceive", |false, 0|
|000032e0| 2c 20 28 57 69 6e 64 6f | 77 50 74 72 29 20 28 2d |, (Windo|wPtr) (-|
|000032f0| 31 29 2c 20 66 61 6c 73 | 65 2c 20 30 29 3b 0d 09 |1), fals|e, 0);..|
|00003300| 09 69 66 20 28 64 75 6d | 6d 79 20 3d 3d 20 4e 55 |.if (dum|my == NU|
|00003310| 4c 4c 29 20 7b 20 65 72 | 72 20 3d 20 6d 65 6d 46 |LL) { er|r = memF|
|00003320| 75 6c 6c 45 72 72 3b 20 | 67 6f 74 6f 20 62 61 69 |ullErr; |goto bai|
|00003330| 6c 3b 20 7d 0d 09 09 28 | 2a 66 74 74 29 2d 3e 6f |l; }...(|*ftt)->o|
|00003340| 77 6e 65 72 20 3d 20 64 | 75 6d 6d 79 3b 0d 09 7d |wner = d|ummy;..}|
|00003350| 0d 09 09 0d 09 09 2f 2a | 20 73 65 6e 64 20 74 68 |....../*| send th|
|00003360| 65 20 66 69 6c 65 20 2a | 2f 0d 09 65 72 72 20 3d |e file *|/..err =|
|00003370| 20 46 54 53 74 61 72 74 | 28 66 74 74 2c 20 66 74 | FTStart|(ftt, ft|
|00003380| 52 65 63 65 69 76 69 6e | 67 2c 20 26 66 69 6c 65 |Receivin|g, &file|
|00003390| 69 6e 66 6f 29 3b 0d 09 | 69 66 20 28 65 72 72 20 |info);..|if (err |
|000033a0| 21 3d 20 6e 6f 45 72 72 | 29 20 67 6f 74 6f 20 62 |!= noErr|) goto b|
|000033b0| 61 69 6c 3b 0d 09 77 68 | 69 6c 65 20 28 21 46 54 |ail;..wh|ile (!FT|
|000033c0| 54 44 6f 6e 65 54 72 61 | 6e 73 66 65 72 28 66 74 |TDoneTra|nsfer(ft|
|000033d0| 74 29 29 20 7b 0d 09 09 | 46 54 45 78 65 63 28 66 |t)) {...|FTExec(f|
|000033e0| 74 74 29 3b 0d 09 09 43 | 4d 49 64 6c 65 28 63 6f |tt);...C|MIdle(co|
|000033f0| 6e 6e 29 3b 0d 09 09 43 | 6f 6e 6e 46 74 74 45 76 |nn);...C|onnFttEv|
|00003400| 65 6e 74 48 6f 6f 6b 28 | 63 6f 6e 6e 2c 20 66 74 |entHook(|conn, ft|
|00003410| 74 2c 20 68 6f 6f 6b 29 | 3b 0d 09 7d 0d 09 69 66 |t, hook)|;..}..if|
|00003420| 20 28 21 46 54 54 53 75 | 63 63 65 73 73 66 75 6c | (!FTTSu|ccessful|
|00003430| 54 72 61 6e 73 66 65 72 | 28 66 74 74 29 29 20 7b |Transfer|(ftt)) {|
|00003440| 20 65 72 72 20 3d 20 61 | 62 6f 72 74 45 72 72 3b | err = a|bortErr;|
|00003450| 20 67 6f 74 6f 20 62 61 | 69 6c 3b 20 7d 0d 09 0d | goto ba|il; }...|
|00003460| 09 09 2f 2a 20 66 69 67 | 75 72 65 20 6f 75 74 20 |../* fig|ure out |
|00003470| 74 68 65 20 6e 65 77 20 | 66 69 6c 65 20 6e 61 6d |the new |file nam|
|00003480| 65 2d 2d 66 69 72 73 74 | 20 66 69 6c 65 20 69 6e |e--first| file in|
|00003490| 20 74 65 6d 70 20 64 69 | 72 20 2a 2f 0d 09 6d 65 | temp di|r */..me|
|000034a0| 6d 73 65 74 28 26 66 70 | 2c 20 30 2c 20 73 69 7a |mset(&fp|, 0, siz|
|000034b0| 65 6f 66 28 66 70 29 29 | 3b 0d 09 66 70 2e 69 6f |eof(fp))|;..fp.io|
|000034c0| 4e 61 6d 65 50 74 72 20 | 3d 20 6e 61 6d 65 3b 0d |NamePtr |= name;.|
|000034d0| 09 66 70 2e 69 6f 56 52 | 65 66 4e 75 6d 20 3d 20 |.fp.ioVR|efNum = |
|000034e0| 76 6f 6c 3b 0d 09 66 70 | 2e 69 6f 46 44 69 72 49 |vol;..fp|.ioFDirI|
|000034f0| 6e 64 65 78 20 3d 20 31 | 3b 0d 09 66 70 2e 69 6f |ndex = 1|;..fp.io|
|00003500| 44 69 72 49 44 20 3d 20 | 74 65 6d 70 64 69 72 3b |DirID = |tempdir;|
|00003510| 0d 09 50 42 48 47 65 74 | 46 49 6e 66 6f 53 79 6e |..PBHGet|FInfoSyn|
|00003520| 63 28 28 48 50 61 72 6d | 42 6c 6b 50 74 72 29 20 |c((HParm|BlkPtr) |
|00003530| 26 66 70 29 3b 0d 0d 09 | 09 2f 2a 20 6d 6f 76 65 |&fp);...|./* move|
|00003540| 20 74 68 65 20 66 69 6c | 65 20 62 61 63 6b 20 74 | the fil|e back t|
|00003550| 6f 20 6f 72 69 67 69 6e | 61 6c 20 64 69 72 65 63 |o origin|al direc|
|00003560| 74 6f 72 79 2a 2f 0d 09 | 72 65 6e 61 6d 65 63 6f |tory*/..|renameco|
|00003570| 75 6e 74 20 3d 20 31 3b | 0d 09 77 68 69 6c 65 20 |unt = 1;|..while |
|00003580| 28 28 65 72 72 20 3d 20 | 43 61 74 4d 6f 76 65 28 |((err = |CatMove(|
|00003590| 76 6f 6c 2c 20 74 65 6d | 70 64 69 72 2c 20 6e 61 |vol, tem|pdir, na|
|000035a0| 6d 65 2c 20 64 69 72 2c | 20 4e 55 4c 4c 29 29 20 |me, dir,| NULL)) |
|000035b0| 3d 3d 20 64 75 70 46 4e | 45 72 72 29 20 7b 0d 09 |== dupFN|Err) {..|
|000035c0| 09 69 66 20 28 6e 65 77 | 4e 61 6d 65 5b 30 5d 20 |.if (new|Name[0] |
|000035d0| 3e 20 32 39 29 20 6e 65 | 77 4e 61 6d 65 5b 30 5d |> 29) ne|wName[0]|
|000035e0| 20 3d 20 32 39 3b 20 2f | 2a 20 6d 61 6b 65 20 73 | = 29; /|* make s|
|000035f0| 75 72 65 20 77 65 20 68 | 61 76 65 20 32 20 63 68 |ure we h|ave 2 ch|
|00003600| 61 72 73 20 66 6f 72 20 | 74 68 65 20 6e 75 6d 62 |ars for |the numb|
|00003610| 65 72 20 2a 2f 0d 09 09 | 50 4c 73 74 72 63 70 79 |er */...|PLstrcpy|
|00003620| 28 6e 65 77 4e 61 6d 65 | 2c 20 6e 61 6d 65 29 3b |(newName|, name);|
|00003630| 0d 09 09 50 4c 73 74 72 | 63 61 74 28 6e 65 77 4e |...PLstr|cat(newN|
|00003640| 61 6d 65 2c 20 22 5c 70 | 20 22 29 3b 0d 09 09 4e |ame, "\p| ");...N|
|00003650| 75 6d 54 6f 53 74 72 69 | 6e 67 28 72 65 6e 61 6d |umToStri|ng(renam|
|00003660| 65 63 6f 75 6e 74 2b 2b | 2c 20 73 29 3b 0d 09 09 |ecount++|, s);...|
|00003670| 69 66 20 28 73 5b 30 5d | 20 3d 3d 20 31 29 20 50 |if (s[0]| == 1) P|
|00003680| 4c 73 74 72 63 61 74 28 | 6e 65 77 4e 61 6d 65 2c |Lstrcat(|newName,|
|00003690| 20 22 5c 70 30 22 29 3b | 0d 09 09 50 4c 73 74 72 | "\p0");|...PLstr|
|000036a0| 63 61 74 28 6e 65 77 4e | 61 6d 65 2c 20 73 29 3b |cat(newN|ame, s);|
|000036b0| 0d 09 09 48 52 65 6e 61 | 6d 65 28 76 6f 6c 2c 20 |...HRena|me(vol, |
|000036c0| 74 65 6d 70 64 69 72 2c | 20 6e 61 6d 65 2c 20 6e |tempdir,| name, n|
|000036d0| 65 77 4e 61 6d 65 29 3b | 0d 09 09 50 4c 73 74 72 |ewName);|...PLstr|
|000036e0| 63 70 79 28 6e 61 6d 65 | 2c 20 6e 65 77 4e 61 6d |cpy(name|, newNam|
|000036f0| 65 29 3b 0d 09 7d 0d 09 | 69 66 20 28 65 72 72 20 |e);..}..|if (err |
|00003700| 21 3d 20 6e 6f 45 72 72 | 29 20 7b 0d 09 09 48 44 |!= noErr|) {...HD|
|00003710| 65 6c 65 74 65 28 76 6f | 6c 2c 20 74 65 6d 70 64 |elete(vo|l, tempd|
|00003720| 69 72 2c 20 6e 61 6d 65 | 29 3b 0d 09 09 67 6f 74 |ir, name|);...got|
|00003730| 6f 20 62 61 69 6c 3b 0d | 09 7d 0d 09 0d 09 09 2f |o bail;.|.}...../|
|00003740| 2a 20 63 6c 65 61 6e 20 | 75 70 20 61 6e 64 20 6c |* clean |up and l|
|00003750| 65 61 76 65 20 2a 2f 0d | 09 46 54 44 69 73 70 6f |eave */.|.FTDispo|
|00003760| 73 65 28 66 74 74 29 3b | 0d 09 43 6c 6f 73 65 57 |se(ftt);|..CloseW|
|00003770| 44 28 77 64 6e 75 6d 29 | 3b 0d 09 48 44 65 6c 65 |D(wdnum)|;..HDele|
|00003780| 74 65 28 76 6f 6c 2c 20 | 64 69 72 2c 20 74 65 6d |te(vol, |dir, tem|
|00003790| 70 64 69 72 6e 61 6d 65 | 29 3b 0d 09 46 6c 75 73 |pdirname|);..Flus|
|000037a0| 68 56 6f 6c 28 4e 55 4c | 4c 2c 20 76 6f 6c 29 3b |hVol(NUL|L, vol);|
|000037b0| 0d 09 69 66 20 28 64 75 | 6d 6d 79 20 21 3d 20 4e |..if (du|mmy != N|
|000037c0| 55 4c 4c 29 20 44 69 73 | 70 6f 73 65 57 69 6e 64 |ULL) Dis|poseWind|
|000037d0| 6f 77 28 64 75 6d 6d 79 | 29 3b 0d 09 72 65 74 75 |ow(dummy|);..retu|
|000037e0| 72 6e 20 6e 6f 45 72 72 | 3b 0d 09 0d 09 09 2f 2a |rn noErr|;...../*|
|000037f0| 20 65 72 72 6f 72 20 68 | 61 6e 64 6c 69 6e 67 20 | error h|andling |
|00003800| 2a 2f 0d 62 61 69 6c 3a | 0d 09 69 66 20 28 64 75 |*/.bail:|..if (du|
|00003810| 6d 6d 79 20 21 3d 20 4e | 55 4c 4c 29 20 44 69 73 |mmy != N|ULL) Dis|
|00003820| 70 6f 73 65 57 69 6e 64 | 6f 77 28 64 75 6d 6d 79 |poseWind|ow(dummy|
|00003830| 29 3b 0d 09 69 66 20 28 | 66 74 74 20 21 3d 20 4e |);..if (|ftt != N|
|00003840| 55 4c 4c 29 20 46 54 44 | 69 73 70 6f 73 65 28 66 |ULL) FTD|ispose(f|
|00003850| 74 74 29 3b 0d 09 69 66 | 20 28 77 64 6e 75 6d 20 |tt);..if| (wdnum |
|00003860| 21 3d 20 30 29 20 7b 20 | 43 6c 6f 73 65 57 44 28 |!= 0) { |CloseWD(|
|00003870| 77 64 6e 75 6d 29 3b 20 | 48 44 65 6c 65 74 65 28 |wdnum); |HDelete(|
|00003880| 76 6f 6c 2c 20 64 69 72 | 2c 20 74 65 6d 70 64 69 |vol, dir|, tempdi|
|00003890| 72 6e 61 6d 65 29 3b 20 | 7d 0d 09 72 65 74 75 72 |rname); |}..retur|
|000038a0| 6e 20 65 72 72 3b 0d 7d | 0d 0d 0d 4f 53 45 72 72 |n err;.}|...OSErr|
|000038b0| 20 53 69 6d 70 6c 65 53 | 65 6e 64 46 69 6c 65 28 | SimpleS|endFile(|
|000038c0| 43 6f 6e 6e 48 61 6e 64 | 6c 65 20 63 6f 6e 6e 2c |ConnHand|le conn,|
|000038d0| 20 73 68 6f 72 74 20 66 | 74 74 63 49 44 2c 20 42 | short f|ttcID, B|
|000038e0| 6f 6f 6c 65 61 6e 20 73 | 68 6f 77 70 72 6f 67 72 |oolean s|howprogr|
|000038f0| 65 73 73 2c 20 43 54 42 | 45 76 65 6e 74 48 6f 6f |ess, CTB|EventHoo|
|00003900| 6b 20 68 6f 6f 6b 2c 20 | 73 68 6f 72 74 20 76 6f |k hook, |short vo|
|00003910| 6c 2c 20 6c 6f 6e 67 20 | 64 69 72 2c 20 53 74 72 |l, long |dir, Str|
|00003920| 69 6e 67 50 74 72 20 6e | 61 6d 65 29 20 7b 0d 09 |ingPtr n|ame) {..|
|00003930| 46 54 48 61 6e 64 6c 65 | 20 66 74 74 3b 0d 09 53 |FTHandle| ftt;..S|
|00003940| 46 52 65 70 6c 79 20 66 | 69 6c 65 69 6e 66 6f 3b |FReply f|ileinfo;|
|00003950| 0d 09 48 61 6e 64 6c 65 | 20 66 74 74 63 6f 6e 66 |..Handle| fttconf|
|00003960| 69 67 2c 20 68 3b 0d 09 | 4f 53 45 72 72 20 65 72 |ig, h;..|OSErr er|
|00003970| 72 3b 0d 09 52 65 63 74 | 20 62 6f 75 6e 64 73 3b |r;..Rect| bounds;|
|00003980| 0d 09 57 69 6e 64 6f 77 | 50 74 72 20 64 75 6d 6d |..Window|Ptr dumm|
|00003990| 79 3b 0d 09 73 68 6f 72 | 74 20 77 64 6e 75 6d 3b |y;..shor|t wdnum;|
|000039a0| 0d 09 46 49 6e 66 6f 20 | 66 6e 64 72 49 6e 66 6f |..FInfo |fndrInfo|
|000039b0| 3b 0d 09 0d 09 09 2f 2a | 20 73 65 74 20 75 70 20 |;...../*| set up |
|000039c0| 61 20 73 61 66 65 20 73 | 74 61 74 65 20 2a 2f 0d |a safe s|tate */.|
|000039d0| 09 66 74 74 20 3d 20 4e | 55 4c 4c 3b 0d 09 77 64 |.ftt = N|ULL;..wd|
|000039e0| 6e 75 6d 20 3d 20 30 3b | 0d 09 64 75 6d 6d 79 20 |num = 0;|..dummy |
|000039f0| 3d 20 4e 55 4c 4c 3b 0d | 09 0d 09 09 2f 2a 20 73 |= NULL;.|..../* s|
|00003a00| 65 74 20 75 70 20 74 68 | 65 20 66 69 6c 65 20 69 |et up th|e file i|
|00003a10| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 2a 2f 0d 09 6d |nformati|on */..m|
|00003a20| 65 6d 73 65 74 28 26 66 | 69 6c 65 69 6e 66 6f 2c |emset(&f|ileinfo,|
|00003a30| 20 30 2c 20 73 69 7a 65 | 6f 66 28 66 69 6c 65 69 | 0, size|of(filei|
|00003a40| 6e 66 6f 29 29 3b 0d 09 | 65 72 72 20 3d 20 4f 70 |nfo));..|err = Op|
|00003a50| 65 6e 57 44 28 76 6f 6c | 2c 20 64 69 72 2c 20 27 |enWD(vol|, dir, '|
|00003a60| 46 54 54 43 27 2c 20 26 | 77 64 6e 75 6d 29 3b 0d |FTTC', &|wdnum);.|
|00003a70| 09 69 66 20 28 65 72 72 | 20 21 3d 20 6e 6f 45 72 |.if (err| != noEr|
|00003a80| 72 29 20 67 6f 74 6f 20 | 62 61 69 6c 3b 0d 09 65 |r) goto |bail;..e|
|00003a90| 72 72 20 3d 20 48 47 65 | 74 46 49 6e 66 6f 28 76 |rr = HGe|tFInfo(v|
|00003aa0| 6f 6c 2c 20 64 69 72 2c | 20 6e 61 6d 65 2c 20 26 |ol, dir,| name, &|
|00003ab0| 66 6e 64 72 49 6e 66 6f | 29 3b 0d 09 69 66 20 28 |fndrInfo|);..if (|
|00003ac0| 65 72 72 20 21 3d 20 6e | 6f 45 72 72 29 20 67 6f |err != n|oErr) go|
|00003ad0| 74 6f 20 62 61 69 6c 3b | 0d 09 66 69 6c 65 69 6e |to bail;|..filein|
|00003ae0| 66 6f 2e 67 6f 6f 64 20 | 3d 20 74 72 75 65 3b 0d |fo.good |= true;.|
|00003af0| 09 66 69 6c 65 69 6e 66 | 6f 2e 66 54 79 70 65 20 |.fileinf|o.fType |
|00003b00| 3d 20 66 6e 64 72 49 6e | 66 6f 2e 66 64 54 79 70 |= fndrIn|fo.fdTyp|
|00003b10| 65 3b 0d 09 50 4c 73 74 | 72 63 70 79 28 66 69 6c |e;..PLst|rcpy(fil|
|00003b20| 65 69 6e 66 6f 2e 66 4e | 61 6d 65 2c 20 6e 61 6d |einfo.fN|ame, nam|
|00003b30| 65 29 3b 0d 09 66 69 6c | 65 69 6e 66 6f 2e 76 52 |e);..fil|einfo.vR|
|00003b40| 65 66 4e 75 6d 20 3d 20 | 77 64 6e 75 6d 3b 0d 0d |efNum = |wdnum;..|
|00003b50| 09 09 2f 2a 20 67 65 74 | 20 74 68 65 20 66 69 6c |../* get| the fil|
|00003b60| 65 20 74 72 61 6e 73 66 | 65 72 20 74 6f 6f 6c 20 |e transf|er tool |
|00003b70| 2a 2f 0d 09 66 74 74 63 | 6f 6e 66 69 67 20 3d 20 |*/..fttc|onfig = |
|00003b80| 47 65 74 52 65 73 6f 75 | 72 63 65 28 72 46 69 6c |GetResou|rce(rFil|
|00003b90| 65 54 43 6f 6e 66 69 67 | 2c 20 66 74 74 63 49 44 |eTConfig|, fttcID|
|00003ba0| 29 3b 0d 09 69 66 20 28 | 66 74 74 63 6f 6e 66 69 |);..if (|fttconfi|
|00003bb0| 67 20 3d 3d 20 4e 55 4c | 4c 29 20 7b 20 65 72 72 |g == NUL|L) { err|
|00003bc0| 20 3d 20 20 72 65 73 4e | 6f 74 46 6f 75 6e 64 3b | = resN|otFound;|
|00003bd0| 20 67 6f 74 6f 20 62 61 | 69 6c 3b 20 7d 0d 09 65 | goto ba|il; }..e|
|00003be0| 72 72 20 3d 20 47 65 74 | 43 6f 6e 66 69 67 75 72 |rr = Get|Configur|
|00003bf0| 65 64 46 54 54 28 66 74 | 74 63 6f 6e 66 69 67 2c |edFTT(ft|tconfig,|
|00003c00| 20 26 66 74 74 2c 20 63 | 6f 6e 6e 29 3b 0d 09 69 | &ftt, c|onn);..i|
|00003c10| 66 20 28 65 72 72 21 3d | 20 6e 6f 45 72 72 29 20 |f (err!=| noErr) |
|00003c20| 67 6f 74 6f 20 62 61 69 | 6c 3b 0d 09 0d 09 09 2f |goto bai|l;...../|
|00003c30| 2a 20 73 65 74 20 75 70 | 20 61 20 64 75 6d 6d 79 |* set up| a dummy|
|00003c40| 20 77 69 6e 64 6f 77 20 | 66 6f 72 20 74 68 65 20 | window |for the |
|00003c50| 74 6f 6f 6c 20 74 6f 20 | 70 6f 73 69 74 69 6f 6e |tool to |position|
|00003c60| 20 69 74 27 73 20 77 69 | 6e 64 6f 77 20 2a 2f 0d | it's wi|ndow */.|
|00003c70| 09 69 66 20 28 73 68 6f | 77 70 72 6f 67 72 65 73 |.if (sho|wprogres|
|00003c80| 73 29 20 7b 0d 09 09 53 | 65 74 52 65 63 74 28 26 |s) {...S|etRect(&|
|00003c90| 62 6f 75 6e 64 73 2c 20 | 31 30 2c 20 31 30 2c 20 |bounds, |10, 10, |
|00003ca0| 32 30 2c 20 32 30 29 3b | 0d 09 09 4f 66 66 73 65 |20, 20);|...Offse|
|00003cb0| 74 52 65 63 74 28 26 62 | 6f 75 6e 64 73 2c 20 30 |tRect(&b|ounds, 0|
|00003cc0| 2c 20 47 65 74 4d 42 61 | 72 48 65 69 67 68 74 28 |, GetMBa|rHeight(|
|00003cd0| 29 29 3b 0d 09 09 64 75 | 6d 6d 79 20 3d 20 4e 65 |));...du|mmy = Ne|
|00003ce0| 77 57 69 6e 64 6f 77 28 | 4e 55 4c 4c 2c 20 26 62 |wWindow(|NULL, &b|
|00003cf0| 6f 75 6e 64 73 2c 20 22 | 5c 70 53 65 6e 64 22 2c |ounds, "|\pSend",|
|00003d00| 20 66 61 6c 73 65 2c 20 | 30 2c 20 28 57 69 6e 64 | false, |0, (Wind|
|00003d10| 6f 77 50 74 72 29 20 28 | 2d 31 29 2c 20 66 61 6c |owPtr) (|-1), fal|
|00003d20| 73 65 2c 20 30 29 3b 0d | 09 09 69 66 20 28 64 75 |se, 0);.|..if (du|
|00003d30| 6d 6d 79 20 3d 3d 20 4e | 55 4c 4c 29 20 7b 20 65 |mmy == N|ULL) { e|
|00003d40| 72 72 20 3d 20 6d 65 6d | 46 75 6c 6c 45 72 72 3b |rr = mem|FullErr;|
|00003d50| 20 67 6f 74 6f 20 62 61 | 69 6c 3b 20 7d 0d 09 09 | goto ba|il; }...|
|00003d60| 28 2a 66 74 74 29 2d 3e | 6f 77 6e 65 72 20 3d 20 |(*ftt)->|owner = |
|00003d70| 64 75 6d 6d 79 3b 0d 09 | 7d 0d 09 09 0d 09 09 2f |dummy;..|}....../|
|00003d80| 2a 20 73 65 6e 64 20 74 | 68 65 20 66 69 6c 65 20 |* send t|he file |
|00003d90| 2a 2f 0d 09 65 72 72 20 | 3d 20 46 54 53 74 61 72 |*/..err |= FTStar|
|00003da0| 74 28 66 74 74 2c 20 66 | 74 54 72 61 6e 73 6d 69 |t(ftt, f|tTransmi|
|00003db0| 74 74 69 6e 67 2c 20 26 | 66 69 6c 65 69 6e 66 6f |tting, &|fileinfo|
|00003dc0| 29 3b 0d 09 69 66 20 28 | 65 72 72 20 21 3d 20 6e |);..if (|err != n|
|00003dd0| 6f 45 72 72 29 20 67 6f | 74 6f 20 62 61 69 6c 3b |oErr) go|to bail;|
|00003de0| 0d 09 77 68 69 6c 65 20 | 28 21 46 54 54 44 6f 6e |..while |(!FTTDon|
|00003df0| 65 54 72 61 6e 73 66 65 | 72 28 66 74 74 29 29 20 |eTransfe|r(ftt)) |
|00003e00| 7b 0d 09 09 46 54 45 78 | 65 63 28 66 74 74 29 3b |{...FTEx|ec(ftt);|
|00003e10| 0d 09 09 43 4d 49 64 6c | 65 28 63 6f 6e 6e 29 3b |...CMIdl|e(conn);|
|00003e20| 0d 09 09 43 6f 6e 6e 46 | 74 74 45 76 65 6e 74 48 |...ConnF|ttEventH|
|00003e30| 6f 6f 6b 28 63 6f 6e 6e | 2c 20 66 74 74 2c 20 68 |ook(conn|, ftt, h|
|00003e40| 6f 6f 6b 29 3b 0d 09 7d | 0d 09 69 66 20 28 21 46 |ook);..}|..if (!F|
|00003e50| 54 54 53 75 63 63 65 73 | 73 66 75 6c 54 72 61 6e |TTSucces|sfulTran|
|00003e60| 73 66 65 72 28 66 74 74 | 29 29 20 7b 20 65 72 72 |sfer(ftt|)) { err|
|00003e70| 20 3d 20 61 62 6f 72 74 | 45 72 72 3b 20 67 6f 74 | = abort|Err; got|
|00003e80| 6f 20 62 61 69 6c 3b 20 | 7d 0d 09 0d 09 09 2f 2a |o bail; |}...../*|
|00003e90| 20 63 6c 65 61 6e 20 75 | 70 20 61 6e 64 20 6c 65 | clean u|p and le|
|00003ea0| 61 76 65 20 2a 2f 0d 09 | 46 54 44 69 73 70 6f 73 |ave */..|FTDispos|
|00003eb0| 65 28 66 74 74 29 3b 0d | 09 43 6c 6f 73 65 57 44 |e(ftt);.|.CloseWD|
|00003ec0| 28 77 64 6e 75 6d 29 3b | 0d 09 69 66 20 28 64 75 |(wdnum);|..if (du|
|00003ed0| 6d 6d 79 20 21 3d 20 4e | 55 4c 4c 29 20 44 69 73 |mmy != N|ULL) Dis|
|00003ee0| 70 6f 73 65 57 69 6e 64 | 6f 77 28 64 75 6d 6d 79 |poseWind|ow(dummy|
|00003ef0| 29 3b 0d 09 72 65 74 75 | 72 6e 20 6e 6f 45 72 72 |);..retu|rn noErr|
|00003f00| 3b 0d 09 0d 09 09 2f 2a | 20 65 72 72 6f 72 20 68 |;...../*| error h|
|00003f10| 61 6e 64 6c 69 6e 67 20 | 2a 2f 0d 62 61 69 6c 3a |andling |*/.bail:|
|00003f20| 0d 09 69 66 20 28 64 75 | 6d 6d 79 20 21 3d 20 4e |..if (du|mmy != N|
|00003f30| 55 4c 4c 29 20 44 69 73 | 70 6f 73 65 57 69 6e 64 |ULL) Dis|poseWind|
|00003f40| 6f 77 28 64 75 6d 6d 79 | 29 3b 0d 09 69 66 20 28 |ow(dummy|);..if (|
|00003f50| 66 74 74 20 21 3d 20 4e | 55 4c 4c 29 20 46 54 44 |ftt != N|ULL) FTD|
|00003f60| 69 73 70 6f 73 65 28 66 | 74 74 29 3b 0d 09 69 66 |ispose(f|tt);..if|
|00003f70| 20 28 77 64 6e 75 6d 20 | 21 3d 20 30 29 20 43 6c | (wdnum |!= 0) Cl|
|00003f80| 6f 73 65 57 44 28 77 64 | 6e 75 6d 29 3b 0d 09 72 |oseWD(wd|num);..r|
|00003f90| 65 74 75 72 6e 20 65 72 | 72 3b 0d 7d 0d 0d 00 00 |eturn er|r;.}....|
|00003fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004000| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00004010| 20 20 20 69 73 74 72 65 | 61 6d 26 20 28 2a 66 63 | istre|am& (*fc|
|00004020| 74 29 28 69 73 74 72 65 | 61 6d 26 2c 20 54 29 3b |t)(istre|am&, T);|
|00004030| 08 53 74 64 43 54 42 2e | 63 2d 02 00 00 00 54 45 |.StdCTB.|c-....TE|
|00004040| 58 54 4d 50 53 20 01 00 | ff ff ff ff 00 00 00 00 |XTMPS ..|........|
|00004050| 00 00 54 45 58 54 4d 50 | 53 20 01 00 ff ff ff ff |..TEXTMP|S ......|
|00004060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004070| 1b 50 ac 93 59 6c 00 00 | 3f 1e 00 00 01 ac 20 20 |.P..Yl..|?..... |
|00004080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004090| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 5c 0d 20 | | \. |
|000040a0| 20 20 20 20 20 20 20 49 | 41 50 50 28 54 29 28 69 | I|APP(T)(i|
|000040b0| 73 74 72 65 61 6d 26 20 | 28 2a 66 29 28 69 73 74 |stream& |(*f)(ist|
|000040c0| 72 65 61 6d 26 2c 54 29 | 29 20 3a 20 66 63 74 28 |ream&,T)|) : fct(|
|000040d0| 66 29 20 7b 20 7d 20 20 | 20 20 20 20 20 20 20 20 |f) { } | |
|000040e0| 20 20 20 20 20 20 20 5c | 0d 20 20 20 20 20 20 20 | \|. |
|000040f0| 20 49 4d 41 4e 49 50 28 | 54 29 20 6f 70 65 72 61 | IMANIP(|T) opera|
|00004100| 00 00 00 48 00 09 47 65 | 6e 65 76 61 00 00 63 6c |...H..Ge|neva..cl|
|00004110| 03 df bd d0 3c 4f 53 55 | 74 69 6c 73 2e 68 3e 0d |....<OSU|tils.h>.|
|00004120| 23 69 6e 63 6c 75 00 03 | 00 08 00 72 00 02 02 2a |#inclu..|...r...*|
|00004130| 02 15 00 72 00 02 02 2a | 02 15 b0 5f 56 2a 00 00 |...r...*|..._V*..|
|00004140| 00 00 00 00 02 7d 00 00 | 00 00 01 00 00 00 00 1e |.....}..|........|
|00004150| 00 72 00 02 02 2a 02 15 | 00 72 00 02 02 2a 02 15 |.r...*..|.r...*..|
|00004160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004170| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 03 d6 |.....n..|.n...>..|
|00004180| 71 38 26 32 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |q8&2....|.>..MPSR|
|00004190| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|000041a0| 03 f0 ff ff 00 00 00 4c | 03 d7 c9 7c 00 00 00 00 |.......L|...|....|
|000041b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+